]> source.dussan.org Git - redmine.git/commitdiff
use with_settings at AccountControllerOpenidTest#test_login_with_openid_for_existing_...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 17 Dec 2020 13:11:13 +0000 (13:11 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Thu, 17 Dec 2020 13:11:13 +0000 (13:11 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@20664 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/account_controller_openid_test.rb

index 7ed03d00cadab097bd384562fa67a5d2fead621e..1a51fc87991cc2a558f0661b5fba625937f545de 100644 (file)
@@ -62,7 +62,6 @@ class AccountControllerOpenidTest < Redmine::ControllerTest
     end
 
     def test_login_with_openid_for_existing_non_active_user
-      Setting.self_registration = '2'
       existing_user = User.new(:firstname => 'Cool',
                                :lastname => 'User',
                                :mail => 'user@somedomain.com',
@@ -70,13 +69,12 @@ class AccountControllerOpenidTest < Redmine::ControllerTest
                                :status => User::STATUS_REGISTERED)
       existing_user.login = 'cool_user'
       assert existing_user.save!
-
-      post(
-        :login,
-        :params => {
-          :openid_url => existing_user.identity_url
-        }
-      )
+      with_settings(
+        :openid => '1',
+        :self_registration => '2'
+      ) do
+        post(:login, :params => {:openid_url => existing_user.identity_url})
+      end
       assert_redirected_to '/login'
     end