diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-07-26 08:46:33 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2008-07-26 08:46:33 +0000 |
commit | 9f92554319144effbab13b688b07d15cdafea89a (patch) | |
tree | 4deda817a75d68caef0cb2fd205766dc68ea01db /test | |
parent | 5564dfbbd5a31362fde86f27ac8beccd1661d6f8 (diff) | |
download | redmine-9f92554319144effbab13b688b07d15cdafea89a.tar.gz redmine-9f92554319144effbab13b688b07d15cdafea89a.zip |
Redirect user to the previous page after logging in (#1679).
git-svn-id: http://redmine.rubyforge.org/svn/trunk@1695 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/account_controller_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/functional/account_controller_test.rb b/test/functional/account_controller_test.rb index 666acf0dd..26218d177 100644 --- a/test/functional/account_controller_test.rb +++ b/test/functional/account_controller_test.rb @@ -44,6 +44,17 @@ class AccountControllerTest < Test::Unit::TestCase assert_nil assigns(:user) end + def test_login_should_redirect_to_back_url_param + # request.uri is "test.host" in test environment + post :login, :username => 'jsmith', :password => 'jsmith', :back_url => 'http://test.host/issues/show/1' + assert_redirected_to '/issues/show/1' + end + + def test_login_should_not_redirect_to_another_host + post :login, :username => 'jsmith', :password => 'jsmith', :back_url => 'http://test.foo/fake' + assert_redirected_to '/my/page' + end + def test_login_with_wrong_password post :login, :username => 'admin', :password => 'bad' assert_response :success |