From a20458612ef3ada099416b3180e8a2f7d31458b3 Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sat, 3 Sep 2016 07:21:32 +0000 Subject: 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 --- test/unit/issue_test.rb | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'test/unit/issue_test.rb') 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 -- cgit v1.2.3