Sha256: b7306096f0aa1a17c643842b1791d032cfc49a23e0288eae3c08821dd43b8189

Contents?: true

Size: 780 Bytes

Versions: 7

Compression:

Stored size: 780 Bytes

Contents

require 'rspec/webservice_matchers'

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 {
      # www.psu.edu only supports HTTP, port 80.
      # TODO: set up a test server for this.
      expect('www.psu.edu').to have_a_valid_cert    
    }.to raise_error(RSpec::Expectations::ExpectationNotMetError)
  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
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
rspec-webservice_matchers-1.1.2 spec/rspec/webservice_matchers/ssl_spec.rb
rspec-webservice_matchers-1.1.1 spec/rspec/webservice_matchers/ssl_spec.rb
rspec-webservice_matchers-1.1.0 spec/rspec/webservice_matchers/ssl_spec.rb
rspec-webservice_matchers-1.0.0 spec/rspec/webservice_matchers/ssl_spec.rb
rspec-webservice_matchers-0.2.0 spec/rspec/webservice_matchers/ssl_spec.rb
rspec-webservice_matchers-0.1.1 spec/rspec/webservice_matchers/ssl_spec.rb
rspec-webservice_matchers-0.1.0 spec/rspec/webservice_matchers/ssl_spec.rb