]> source.dussan.org Git - redmine.git/commitdiff
Fix a test failure due to the auto watch on issue creation (#38238).
authorGo MAEDA <maeda@farend.jp>
Sun, 15 Oct 2023 01:31:29 +0000 (01:31 +0000)
committerGo MAEDA <maeda@farend.jp>
Sun, 15 Oct 2023 01:31:29 +0000 (01:31 +0000)
Patch by Go MAEDA.

git-svn-id: https://svn.redmine.org/redmine/trunk@22342 e93f8b46-1217-0410-a6f0-8f06a7374b81

test/unit/watcher_test.rb

index 1e95be2f6252e5008cd41fa722cc82a62f65a782..ced49971224748e491d44f12280fe19f3262883d 100644 (file)
@@ -110,7 +110,9 @@ class WatcherTest < ActiveSupport::TestCase
   end
 
   def test_watcher_user_ids_should_make_ids_uniq
-    issue = Issue.new(:project => Project.find(1), :tracker_id => 1, :subject => "test", :author => User.find(2))
+    author = User.find(2)
+    author.pref.auto_watch_on = []
+    issue = Issue.new(:project => Project.find(1), :tracker_id => 1, :subject => "test", :author => author)
     issue.watcher_user_ids = ['1', '3', '1']
     issue.save!
     assert_equal 2, issue.watchers.count