summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2012-03-25 19:52:24 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2012-03-25 19:52:24 +0000
commit706f8b1691cdf401d0c135afa5ec9d9f22d04838 (patch)
tree9b1a58aee4877522263dabfcc0c7cd2285468cf2 /test
parent6115a079ec0085bd84aefa8dc48e38ed3a7d23c0 (diff)
downloadredmine-706f8b1691cdf401d0c135afa5ec9d9f22d04838.tar.gz
redmine-706f8b1691cdf401d0c135afa5ec9d9f22d04838.zip
Override watcher_user_ids= to make ids uniq (#10538).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@9269 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/watcher_test.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/unit/watcher_test.rb b/test/unit/watcher_test.rb
index 35651179e..564cd0503 100644
--- a/test/unit/watcher_test.rb
+++ b/test/unit/watcher_test.rb
@@ -81,6 +81,13 @@ class WatcherTest < ActiveSupport::TestCase
assert issue.watched_by?(User.find(1))
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))
+ issue.watcher_user_ids = ['1', '3', '1']
+ issue.save!
+ assert_equal 2, issue.watchers.count
+ end
+
def test_addable_watcher_users
addable_watcher_users = @issue.addable_watcher_users
assert_kind_of Array, addable_watcher_users