summaryrefslogtreecommitdiffstats
path: root/test/unit
diff options
context:
space:
mode:
authorMarius Balteanu <marius.balteanu@zitec.com>2022-06-20 15:18:57 +0000
committerMarius Balteanu <marius.balteanu@zitec.com>2022-06-20 15:18:57 +0000
commit69a8fe2f6d422c9653a7cc16076c3140040fe349 (patch)
tree1686f65a9b940510a4dc2f785b02b3d648423533 /test/unit
parentff872c7e918e925f3d958ebde3c61563109c3552 (diff)
downloadredmine-69a8fe2f6d422c9653a7cc16076c3140040fe349.tar.gz
redmine-69a8fe2f6d422c9653a7cc16076c3140040fe349.zip
Merged r21661 to 5.0-stable (#37065).
git-svn-id: https://svn.redmine.org/redmine/branches/5.0-stable@21667 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r--test/unit/watcher_test.rb15
1 files changed, 14 insertions, 1 deletions
diff --git a/test/unit/watcher_test.rb b/test/unit/watcher_test.rb
index 1638f4fcb..a2de4c192 100644
--- a/test/unit/watcher_test.rb
+++ b/test/unit/watcher_test.rb
@@ -20,7 +20,7 @@
require File.expand_path('../../test_helper', __FILE__)
class WatcherTest < ActiveSupport::TestCase
- fixtures :projects, :users, :email_addresses, :members, :member_roles, :roles, :enabled_modules,
+ fixtures :projects, :groups_users, :users, :email_addresses, :members, :member_roles, :roles, :enabled_modules,
:issues, :issue_statuses, :enumerations, :trackers, :projects_trackers,
:boards, :messages,
:wikis, :wiki_pages,
@@ -60,6 +60,19 @@ class WatcherTest < ActiveSupport::TestCase
assert Issue.watched_by(@user).include?(@issue)
end
+ def test_watched_by_group
+ group = Group.find(10)
+ user = User.find(8)
+ assert @issue.add_watcher(group)
+ @issue.reload
+
+ assert @issue.watched_by?(group)
+ assert Issue.watched_by(group).include?(@issue)
+
+ assert @issue.watched_by?(user)
+ assert Issue.watched_by(user).include?(@issue)
+ end
+
def test_watcher_users
watcher_users = Issue.find(2).watcher_users
assert_kind_of Array, watcher_users.collect{|w| w}