SSL_requirement and RSpec
17 Feb 2010
If you’re using ssl_requirement, and speccing with RSpec, you’ll probably run into a problem whereby the before_filter ensure_proper_protocol redirects during your controller specs. To fix this, you can stub the call to ensure_proper_protocol, and make it return true. Add the following to your spec_helper.rb:
Spec::Runner.configure do |config|
...
config.before(:each, :type => :controller) do
controller.stub(:ensure_proper_protocol).and_return(:true)
end
end