]> source.dussan.org Git - redmine.git/commitdiff
use with_settings at UsersControllerTest#test_update_with_activation_should_send_a_no...
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 15 Nov 2020 12:37:25 +0000 (12:37 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sun, 15 Nov 2020 12:37:25 +0000 (12:37 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@20388 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/users_controller_test.rb

index 1fb05c59320dc1d0807108334284f967ba4cc7f0..0b0d644a9c2d0962e713cde9c4dbd85f803c0c43 100644 (file)
@@ -544,17 +544,21 @@ class UsersControllerTest < Redmine::ControllerTest
   end
 
   def test_update_with_activation_should_send_a_notification
-    u = User.new(:firstname => 'Foo', :lastname => 'Bar', :mail => 'foo.bar@somenet.foo', :language => 'fr')
+    u = User.new(:firstname => 'Foo', :lastname => 'Bar',
+                 :mail => 'foo.bar@somenet.foo', :language => 'fr')
     u.login = 'foo'
     u.status = User::STATUS_REGISTERED
     u.save!
     ActionMailer::Base.deliveries.clear
-    Setting.bcc_recipients = '1'
-
-    put :update, :params => {
-      :id => u.id,
-      :user => {:status => User::STATUS_ACTIVE}
-    }
+    with_settings :bcc_recipients => '1' do
+      put(
+        :update,
+        :params => {
+          :id => u.id,
+          :user => {:status => User::STATUS_ACTIVE}
+        }
+      )
+    end
     assert u.reload.active?
     mail = ActionMailer::Base.deliveries.last
     assert_not_nil mail