# How to black-box test a web app?

**URL:** <https://forum.ansible.com/t/how-to-black-box-test-a-web-app/14374>\
**Category:** Ansible Project\
**Created:** [January 17, 2014, 11:29pm UTC](https://forum.ansible.com/t/how-to-black-box-test-a-web-app/14374 "2014-01-17T23:29:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robb\_Shecter](https://avatars.discourse-cdn.com/v4/letter/r/9de0a6/32.png) [@Robb\_Shecter](https://forum.ansible.com/u/Robb_Shecter)\
**Post date:** [January 17, 2014, 11:29pm UTC](https://forum.ansible.com/t/how-to-black-box-test-a-web-app/14374/1 "2014-01-17T23:29:21Z")

</div>

Hi everyone. In Ruby RSpec, I’m testing my web apps with code like this. Is there a way to make equivalent checks with Ansible? This [http://docs.ansible.com/uri\_module.html](http://docs.ansible.com/uri_module.html) seems like it might help, but I don’t see exactly how I’d use it. Thanks!

```auto
describe 'My app' do
  it 'is configured for ssl' do
    expect('www.myapp.com').to have_a_valid_cert
  end

  it 'redirects to www' do
    expect('http://myapp.com').to redirect_permanently_to 'http://www.myapp.com/'
  end

  it 'forces visitors to use https' do
    expect('myapp.com').to enforce_https_everywhere
  end
end

```

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan2](https://avatars.discourse-cdn.com/v4/letter/m/da6949/32.png) [@Michael\_DeHaan2](https://forum.ansible.com/u/Michael_DeHaan2)\
**Post date:** [January 18, 2014, 9:45pm UTC](https://forum.ansible.com/t/how-to-black-box-test-a-web-app/14374/2 "2014-01-18T21:45:50Z")

</div>

One of the easiest things you could do would be to push and execute your rspec script, or pass the server name as a parameter and execute it locally with local\_action in the host loop, either way.
