[rspec-users] Fake SSL in specs when using ssl_requirement plug-in

Ashley Moran work at ashleymoran.me.uk
Tue Jun 26 07:56:23 EDT 2007


I've used the ssl_required line from the ssl_requirement plug-in at  
the start of a controller for SSL.  Its implemented as redirects so I  
can spec this...

   describe "GET /gap/get_qote" do
     controller_name :gap

     it "should redirect to the HTTPS version of the action" do
       get 'get_quote', :id => "finance"
       response.should redirect_to('https://test.host/gap/get_quote/ 

...with no problems.  But I can't figure out how to fake an SSL  
request in the spec setups so all my other specs are failing as they  
are being treated as non-SSL by the controller and redirected.

Anyone know how to do this?

Thanks in advance

More information about the rspec-users mailing list