summaryrefslogtreecommitdiffstats
path: root/test/unit/group_test.rb
diff options
context:
space:
mode:
authorGo MAEDA <maeda@farend.jp>2020-02-06 08:19:13 +0000
committerGo MAEDA <maeda@farend.jp>2020-02-06 08:19:13 +0000
commitb995014c495b36102f36ec80618f50f3763bcd6f (patch)
tree85c230cf16c300f51f9716299ff7bc48d300c4cf /test/unit/group_test.rb
parent29433771b45319a0b50f182f0dcaf72db1275a30 (diff)
downloadredmine-b995014c495b36102f36ec80618f50f3763bcd6f.tar.gz
redmine-b995014c495b36102f36ec80618f50f3763bcd6f.zip
Allow adding user groups as watchers for issues (#4511).
Patch by Yuichi HARADA. git-svn-id: http://svn.redmine.org/redmine/trunk@19498 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/group_test.rb')
-rw-r--r--test/unit/group_test.rb16
1 files changed, 11 insertions, 5 deletions
diff --git a/test/unit/group_test.rb b/test/unit/group_test.rb
index 77f79500b..37626ac0e 100644
--- a/test/unit/group_test.rb
+++ b/test/unit/group_test.rb
@@ -23,10 +23,9 @@ class GroupTest < ActiveSupport::TestCase
fixtures :projects, :trackers, :issue_statuses, :issues,
:enumerations, :users,
:projects_trackers,
- :roles,
- :member_roles,
- :members,
- :groups_users
+ :roles, :member_roles, :members,
+ :groups_users,
+ :watchers
include Redmine::I18n
@@ -128,14 +127,21 @@ class GroupTest < ActiveSupport::TestCase
assert !User.find(8).member_of?(Project.find(5))
end
- def test_destroy_should_unassign_issues
+ def test_destroy_should_unassign_and_unwatch_issues
group = Group.find(10)
Issue.where(:id => 1).update_all(["assigned_to_id = ?", group.id])
+ issue = Issue.find(2)
+ issue.set_watcher(group)
+ issue.save
+ issue.reload
+ assert issue.watcher_user_ids.include?(10)
assert group.destroy
assert group.destroyed?
assert_nil Issue.find(1).assigned_to_id
+ issue.reload
+ assert !issue.watcher_user_ids.include?(10)
end
def test_builtin_groups_should_be_created_if_missing