Sha256: d1cfcbc37130bfdbbb3be78c966b7c34fb91323440c48416c322510b51411b2e

Contents?: true

Size: 867 Bytes

Versions: 1

Compression:

Stored size: 867 Bytes

Contents

require 'rspec/webservice_matchers'

# VCR may be the tool to use for this. Can it handle https? Would that work?


describe 'have_a_valid_cert matcher' do
  it 'passes when SSL is properly configured' do
    # EFF created the HTTPS Everywhere movement
    # TODO: set up a test server for this. (?)
    expect('www.eff.org').to have_a_valid_cert
  end  

  it 'fails if the server is not serving SSL at all' do
    expect {
      expect('www.psu.edu').to have_a_valid_cert    
    }.to fail
  end
end


# See https://www.eff.org/https-everywhere
describe 'enforce_https_everywhere' do
  it 'passes when http requests are redirected to valid https urls' do
    expect('eff.org').to enforce_https_everywhere
  end

  it 'provides a relevant error message' do
    expect {
      expect('www.psu.edu').to enforce_https_everywhere
    }.to fail_matching(/200/)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rspec-webservice_matchers-1.4.3 spec/rspec/webservice_matchers/ssl_spec.rb