diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-07 05:41:58 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2012-07-07 05:41:58 +0000 |
commit | 8a080d8e53ac9ac4705ba57a58a2421d32686c1d (patch) | |
tree | 329d18d50cefc00c7801a7bb545796ab1c01e09b /test | |
parent | 6351631ec618849d1fa9c6e88efb5c1b93f7aa6c (diff) | |
download | redmine-8a080d8e53ac9ac4705ba57a58a2421d32686c1d.tar.gz redmine-8a080d8e53ac9ac4705ba57a58a2421d32686c1d.zip |
Enable openid in test case setup.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9927 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/account_controller_openid_test.rb | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/test/functional/account_controller_openid_test.rb b/test/functional/account_controller_openid_test.rb index 220cecb6e..5e7ef7711 100644 --- a/test/functional/account_controller_openid_test.rb +++ b/test/functional/account_controller_openid_test.rb @@ -23,13 +23,17 @@ class AccountControllerTest < ActionController::TestCase def setup User.current = nil + Setting.openid = '1' + end + + def teardown + Setting.openid = '0' end if Object.const_defined?(:OpenID) def test_login_with_openid_for_existing_user Setting.self_registration = '3' - Setting.openid = '1' existing_user = User.new(:firstname => 'Cool', :lastname => 'User', :mail => 'user@somedomain.com', @@ -43,14 +47,12 @@ class AccountControllerTest < ActionController::TestCase def test_login_with_invalid_openid_provider Setting.self_registration = '0' - Setting.openid = '1' post :login, :openid_url => 'http;//openid.example.com/good_user' assert_redirected_to home_url end def test_login_with_openid_for_existing_non_active_user Setting.self_registration = '2' - Setting.openid = '1' existing_user = User.new(:firstname => 'Cool', :lastname => 'User', :mail => 'user@somedomain.com', @@ -65,7 +67,6 @@ class AccountControllerTest < ActionController::TestCase def test_login_with_openid_with_new_user_created Setting.self_registration = '3' - Setting.openid = '1' post :login, :openid_url => 'http://openid.example.com/good_user' assert_redirected_to '/my/account' user = User.find_by_login('cool_user') @@ -76,7 +77,6 @@ class AccountControllerTest < ActionController::TestCase def test_login_with_openid_with_new_user_and_self_registration_off Setting.self_registration = '0' - Setting.openid = '1' post :login, :openid_url => 'http://openid.example.com/good_user' assert_redirected_to home_url user = User.find_by_login('cool_user') @@ -85,7 +85,6 @@ class AccountControllerTest < ActionController::TestCase def test_login_with_openid_with_new_user_created_with_email_activation_should_have_a_token Setting.self_registration = '1' - Setting.openid = '1' post :login, :openid_url => 'http://openid.example.com/good_user' assert_redirected_to '/login' user = User.find_by_login('cool_user') @@ -97,7 +96,6 @@ class AccountControllerTest < ActionController::TestCase def test_login_with_openid_with_new_user_created_with_manual_activation Setting.self_registration = '2' - Setting.openid = '1' post :login, :openid_url => 'http://openid.example.com/good_user' assert_redirected_to '/login' user = User.find_by_login('cool_user') @@ -107,7 +105,6 @@ class AccountControllerTest < ActionController::TestCase def test_login_with_openid_with_new_user_with_conflict_should_register Setting.self_registration = '3' - Setting.openid = '1' existing_user = User.new(:firstname => 'Cool', :lastname => 'User', :mail => 'user@somedomain.com') existing_user.login = 'cool_user' assert existing_user.save! @@ -120,7 +117,6 @@ class AccountControllerTest < ActionController::TestCase end def test_setting_openid_should_return_true_when_set_to_true - Setting.openid = '1' assert_equal true, Setting.openid? end |