realestate-com-au / akamai-rspec

Test your akamai configuration with rspec
24 stars 13 forks source link

`be_verifiably_secure` should not fail on 404 response if the SSL/TLS is okay #26

Closed ps-jay closed 7 years ago

ps-jay commented 7 years ago

The be_verifiably_secure test shouldn't fail on HTTP response codes, if these were delivered over a verified secure channel.

     Failure/Error: expect(bff_url).to be_verifiably_secure
       got error 404 Resource Not Found: {"message":"Not found"} fetching
<..snip..>
DanielHeath commented 7 years ago

Looks like it should be reasonably easy to handle RestClient::NotFound alongside RestClient::MaxRedirectsReached in https://github.com/realestate-com-au/akamai-rspec/blob/master/lib/akamai_rspec/matchers/non_akamai.rb#L42

I'd be happy with a PR adding this (and a test).

ps-jay commented 7 years ago

Hey Daniel,

What about testing for: RestClient::ExceptionWithResponse ?

Would require an upgrade to rest-client v2 however... not sure on the difficulty level of that change.

ps-jay commented 7 years ago

Ah ... I see... v2 breaks the world : (

/usr/local/bin/ruby -I/usr/local/lib/ruby/gems/2.1.0/gems/rspec-core-3.6.0/lib:/usr/local/lib/ruby/gems/2.1.0/gems/rspec-support-3.6.0/lib /usr/local/lib/ruby/gems/2.1.0/gems/rspec-core-3.6.0/exe/rspec --pattern spec/\*\*\{,/\*/\*\*\}/\*_spec.rb
FFFFFFFFFFFFFFFF*FFFFFFFFFFF..FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF...

<..snip..>

Finished in 0.1234 seconds (files took 0.41314 seconds to load)
64 examples, 58 failures, 1 pending
ps-jay commented 7 years ago

Fix proposed in https://github.com/realestate-com-au/akamai-rspec/pull/28

ps-jay commented 7 years ago

Fixed in https://github.com/realestate-com-au/akamai-rspec/pull/28