diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-07-28 14:58:06 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2013-07-28 14:58:06 +0000 |
commit | 474453d2b0afc51fd87a03cb110db53f57ab1899 (patch) | |
tree | a77ead25d0fb74b938889c87b65d3209c98796a1 /test/unit | |
parent | 9a0db9cb888c16f72a626ac8202dfbc189d18e05 (diff) | |
download | redmine-474453d2b0afc51fd87a03cb110db53f57ab1899.tar.gz redmine-474453d2b0afc51fd87a03cb110db53f57ab1899.zip |
Additional status transitions for assignees do not work if assigned to a group (#14447).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@12056 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit')
-rw-r--r-- | test/unit/issue_test.rb | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index ce5c50ac7..ef1a3fb03 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -509,9 +509,9 @@ class IssueTest < ActiveSupport::TestCase WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 3, :author => true, :assignee => false) - WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, - :new_status_id => 4, :author => false, - :assignee => true) + WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, + :old_status_id => 1, :new_status_id => 4, + :author => false, :assignee => true) WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, :old_status_id => 1, :new_status_id => 5, :author => true, :assignee => true) @@ -537,6 +537,26 @@ class IssueTest < ActiveSupport::TestCase :project_id => 1, :author => user, :assigned_to => user) assert_equal [1, 2, 3, 4, 5], issue.new_statuses_allowed_to(user).map(&:id) + + group = Group.generate! + group.users << user + issue = Issue.generate!(:tracker => tracker, :status => status, + :project_id => 1, :author => user, + :assigned_to => group) + assert_equal [1, 2, 3, 4, 5], issue.new_statuses_allowed_to(user).map(&:id) + end + + def test_new_statuses_allowed_to_should_consider_group_assignment + WorkflowTransition.delete_all + WorkflowTransition.create!(:role_id => 1, :tracker_id => 1, + :old_status_id => 1, :new_status_id => 4, + :author => false, :assignee => true) + user = User.find(2) + group = Group.generate! + group.users << user + + issue = Issue.generate!(:author_id => 1, :assigned_to => group) + assert_include 4, issue.new_statuses_allowed_to(user).map(&:id) end def test_new_statuses_allowed_to_should_return_all_transitions_for_admin |