diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-07-16 07:43:16 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-07-16 07:43:16 +0000 |
commit | 6cc6a918b4f36dbad445a5756f174b767e4ad61b (patch) | |
tree | 87704465c1a28284c466744eb6418cbd8adb1e22 /test/functional/sessions_controller_test.rb | |
parent | 11c85279ab2a8e660666e2c0c80025e2e2513940 (diff) | |
download | redmine-6cc6a918b4f36dbad445a5756f174b767e4ad61b.tar.gz redmine-6cc6a918b4f36dbad445a5756f174b767e4ad61b.zip |
Pass parameters with :params in controller tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@15666 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/sessions_controller_test.rb')
-rw-r--r-- | test/functional/sessions_controller_test.rb | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/test/functional/sessions_controller_test.rb b/test/functional/sessions_controller_test.rb index cdc972fb8..f362947b5 100644 --- a/test/functional/sessions_controller_test.rb +++ b/test/functional/sessions_controller_test.rb @@ -35,7 +35,7 @@ class SessionsControllerTest < Redmine::ControllerTest token = Token.create!(:user_id => 2, :action => 'session', :created_on => 10.hours.ago, :updated_on => 10.hours.ago) created = token.reload.created_on - get :index, {}, {:user_id => 2, :tk => token.value} + get :index, :session => {:user_id => 2, :tk => token.value} assert_response :success token.reload assert_equal created.to_i, token.created_on.to_i @@ -48,13 +48,13 @@ class SessionsControllerTest < Redmine::ControllerTest token = Token.create!(:user_id => 2, :action => 'session', :created_on => created, :updated_on => created) with_settings :session_lifetime => '0', :session_timeout => '0' do - get :index, {}, {:user_id => 2, :tk => token.value} + get :index, :session => {:user_id => 2, :tk => token.value} assert_response :success end end def test_user_session_without_token_should_be_reset - get :index, {}, {:user_id => 2} + get :index, :session => {:user_id => 2} assert_redirected_to 'http://test.host/login?back_url=http%3A%2F%2Ftest.host%2F' end @@ -63,7 +63,7 @@ class SessionsControllerTest < Redmine::ControllerTest token = Token.create!(:user_id => 2, :action => 'session', :created_on => created, :updated_on => created) with_settings :session_timeout => '720' do - get :index, {}, {:user_id => 2, :tk => token.value} + get :index, :session => {:user_id => 2, :tk => token.value} assert_redirected_to 'http://test.host/login?back_url=http%3A%2F%2Ftest.host%2F' end end @@ -73,7 +73,7 @@ class SessionsControllerTest < Redmine::ControllerTest token = Token.create!(:user_id => 2, :action => 'session', :created_on => created, :updated_on => created) with_settings :session_timeout => '720' do - get :index, {}, {:user_id => 2, :tk => token.value} + get :index, :session => {:user_id => 2, :tk => token.value} assert_response :success end end @@ -83,7 +83,7 @@ class SessionsControllerTest < Redmine::ControllerTest token = Token.create!(:user_id => 2, :action => 'session', :created_on => created, :updated_on => created) with_settings :session_timeout => '60' do - get :index, {}, {:user_id => 2, :tk => token.value} + get :index, :session => {:user_id => 2, :tk => token.value} assert_redirected_to 'http://test.host/login?back_url=http%3A%2F%2Ftest.host%2F' end end @@ -93,7 +93,7 @@ class SessionsControllerTest < Redmine::ControllerTest token = Token.create!(:user_id => 2, :action => 'session', :created_on => created, :updated_on => created) with_settings :session_timeout => '60' do - get :index, {}, {:user_id => 2, :tk => token.value} + get :index, :session => {:user_id => 2, :tk => token.value} assert_response :success end end @@ -106,7 +106,7 @@ class SessionsControllerTest < Redmine::ControllerTest autologin_token = Token.create!(:user_id => 2, :action => 'autologin', :created_on => 1.day.ago) @request.cookies['autologin'] = autologin_token.value - get :index, {}, {:user_id => 2, :tk => token.value} + get :index, :session => {:user_id => 2, :tk => token.value} assert_equal 2, session[:user_id] assert_response :success assert_not_equal token.value, session[:tk] @@ -122,7 +122,7 @@ class SessionsControllerTest < Redmine::ControllerTest token = Token.create!(:user_id => 2, :action => 'session', :created_on => created, :updated_on => created) with_settings :session_timeout => '60' do - get :index, {}, {:user_id => user.id, :tk => token.value} + get :index, :session => {:user_id => user.id, :tk => token.value} assert_redirected_to 'http://test.host/login?back_url=http%3A%2F%2Ftest.host%2F' assert_include "Veuillez vous reconnecter", flash[:error] assert_equal :fr, current_language |