]> source.dussan.org Git - redmine.git/commitdiff
use with_settings at UsersControllerTest#test_create
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 14 Nov 2020 13:19:12 +0000 (13:19 +0000)
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>
Sat, 14 Nov 2020 13:19:12 +0000 (13:19 +0000)
git-svn-id: http://svn.redmine.org/redmine/trunk@20375 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/functional/users_controller_test.rb

index 3bf945205191c2d4f512d90199bc6071b756b9f6..1fb05c59320dc1d0807108334284f967ba4cc7f0 100644 (file)
@@ -283,22 +283,25 @@ class UsersControllerTest < Redmine::ControllerTest
   end
 
   def test_create
-    Setting.bcc_recipients = '1'
-
-    assert_difference 'User.count' do
-      assert_difference 'ActionMailer::Base.deliveries.size' do
-        post :create, :params => {
-          :user => {
-            :firstname => 'John',
-            :lastname => 'Doe',
-            :login => 'jdoe',
-            :password => 'secret123',
-            :password_confirmation => 'secret123',
-            :mail => 'jdoe@gmail.com',
-            :mail_notification => 'none'
-          },
-          :send_information => '1'
-        }
+    with_settings :bcc_recipients => '1' do
+      assert_difference 'User.count' do
+        assert_difference 'ActionMailer::Base.deliveries.size' do
+          post(
+            :create,
+            :params => {
+              :user => {
+                :firstname => 'John',
+                :lastname => 'Doe',
+                :login => 'jdoe',
+                :password => 'secret123',
+                :password_confirmation => 'secret123',
+                :mail => 'jdoe@gmail.com',
+                :mail_notification => 'none'
+              },
+              :send_information => '1'
+            }
+          )
+        end
       end
     end