How to black-box test a web app?

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 seems like it might help, but I don’t see exactly how I’d use it. Thanks!

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

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.