diff --git a/app/controllers/application.rb b/app/controllers/application.rb index 6e73ba8..a2c63ea 100644 --- a/app/controllers/application.rb +++ b/app/controllers/application.rb @@ -67,6 +67,7 @@ class ApplicationController < ActionController::Base def avoid_ssl return true if (!request.ssl? || ENV['RAILS_ENV'] == 'development') redirect_to(params.merge(:protocol => 'http://')) + false end before_init_gettext :maybe_save_locale diff --git a/test/functional/application_controller_test.rb b/test/functional/application_controller_test.rb index 5c175eb..4ef9df8 100644 --- a/test/functional/application_controller_test.rb +++ b/test/functional/application_controller_test.rb @@ -412,4 +412,15 @@ class ApplicationControllerTest < Test::Unit::TestCase assert_no_tag :tag => 'div', :attributes => {:id => 'block-' + b.id.to_s} end + should 'return false when not avoid ssl' do + req = mock + req.stubs(:ssl?).returns(true) + + @controller.expects(:request).returns(req) + @controller.stubs(:params).returns({}) + @controller.stubs(:redirect_to) + + assert_equal false, @controller.avoid_ssl + end + end -- libgit2 0.21.2