diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-09-03 07:21:32 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2016-09-03 07:21:32 +0000 |
commit | a20458612ef3ada099416b3180e8a2f7d31458b3 (patch) | |
tree | 43acd848869f78569dbd06595d8a2353b17fc13c /test/unit/issue_test.rb | |
parent | ddc575564744cbc65600a0aaf92f55ec65570e83 (diff) | |
download | redmine-a20458612ef3ada099416b3180e8a2f7d31458b3.tar.gz redmine-a20458612ef3ada099416b3180e8a2f7d31458b3.zip |
When copying an issue, all statuses for new issue should be available (#14696).
git-svn-id: http://svn.redmine.org/redmine/trunk@15810 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/issue_test.rb')
-rw-r--r-- | test/unit/issue_test.rb | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb index 8c95023e7..a532001dc 100644 --- a/test/unit/issue_test.rb +++ b/test/unit/issue_test.rb @@ -775,12 +775,13 @@ class IssueTest < ActiveSupport::TestCase assert_equal expected_statuses, issue.new_statuses_allowed_to(admin) end - def test_new_statuses_allowed_to_should_return_default_and_current_status_when_copying - issue = Issue.find(1).copy - assert_equal [1], issue.new_statuses_allowed_to(User.find(2)).map(&:id) + def test_new_statuses_allowed_to_should_return_allowed_statuses_and_current_status_when_copying + Tracker.find(1).generate_transitions! :role_id => 1, :clear => true, 0 => [1, 3] - issue = Issue.find(2).copy - assert_equal [1, 2], issue.new_statuses_allowed_to(User.find(2)).map(&:id) + orig = Issue.generate!(:project_id => 1, :tracker_id => 1, :status_id => 4) + issue = orig.copy + assert_equal [1, 3, 4], issue.new_statuses_allowed_to(User.find(2)).map(&:id) + assert_equal 4, issue.status_id end def test_safe_attributes_names_should_not_include_disabled_field |