]> source.dussan.org Git - redmine.git/commitdiff
use with_settings at UsersControllerTest#test_update_with_password_change_should_send...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 16 Nov 2020 12:22:54 +0000 (12:22 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Mon, 16 Nov 2020 12:22:54 +0000 (12:22 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@20400 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/users_controller_test.rb

index 0b0d644a9c2d0962e713cde9c4dbd85f803c0c43..4d3f877b234837b6c88f20803218123e9107feaa 100644 (file)
@@ -568,13 +568,19 @@ class UsersControllerTest < Redmine::ControllerTest
 
   def test_update_with_password_change_should_send_a_notification
     ActionMailer::Base.deliveries.clear
-    Setting.bcc_recipients = '1'
-
-    put :update, :params => {
-      :id => 2,
-      :user => {:password => 'newpass123', :password_confirmation => 'newpass123'},
-      :send_information => '1'
-    }
+    with_settings :bcc_recipients => '1' do
+      put(
+        :update,
+        :params => {
+          :id => 2,
+          :user => {
+            :password => 'newpass123',
+            :password_confirmation => 'newpass123'
+          },
+         :send_information => '1'
+        }
+      )
+    end
     u = User.find(2)
     assert u.check_password?('newpass123')