>
> Ok, so I tried just sticking an "ENV['HTTPS'] = 'on'" in my
> spec/spec_helper.rb file and re-running my spec suite. Looks like this is
> not enough in itself, as I got about 77 spec failures, all of them
> apparently caused by "ssl?" returning false and producing unwanted
> redirects.
>

Rails doesn't pull the HTTPS from the env, it pulls it from the request
headers.  In rails integration tests, you specify those by providing a
*third* argument for get/post/put/delete:

  get :show, { :id => :foobar }, { "HTTPS" => "on" }

... If you're using webrat, you can just call

  header("HTTPS", "on")

and that will, as of 0.4, be sticky through all the redirects and everything
else your app can throw at it.  I've been doing this at work for a while,
and it does work.

http://devcaffeine.com/2009/02/16/integration-testing-ssl-with-cucumber/



-- 
// anything worth taking seriously is worth making fun of
// http://blog.devcaffeine.com/
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to