summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2016-10-01 07:43:22 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2016-10-01 07:43:22 +0000
commit752648ebf52431c073ecfa6e27d1f3b8c5142d96 (patch)
treeedc942355db75ffaeedbfd3fabb8d65696fa134b /test
parent08e5fab777e2850c87b050894742d65540016cea (diff)
downloadredmine-752648ebf52431c073ecfa6e27d1f3b8c5142d96.tar.gz
redmine-752648ebf52431c073ecfa6e27d1f3b8c5142d96.zip
closed_on field of copied issue is always set to source issue's value (#23764).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@15848 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test')
-rw-r--r--test/unit/issue_test.rb12
1 files changed, 11 insertions, 1 deletions
diff --git a/test/unit/issue_test.rb b/test/unit/issue_test.rb
index fa6063cfd..d119b5fe6 100644
--- a/test/unit/issue_test.rb
+++ b/test/unit/issue_test.rb
@@ -762,7 +762,7 @@ class IssueTest < ActiveSupport::TestCase
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
@@ -1335,6 +1335,16 @@ class IssueTest < ActiveSupport::TestCase
end
end
+ def test_copy_should_clear_closed_on
+ copied_open = Issue.find(8).copy(:status_id => 1)
+ assert copied_open.save
+ assert_nil copied_open.closed_on
+
+ copied_closed = Issue.find(8).copy
+ assert copied_closed.save
+ assert_not_nil copied_closed.closed_on
+ end
+
def test_should_not_call_after_project_change_on_creation
issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1,
:subject => 'Test', :author_id => 1)