@@ -233,7 +233,7 class Issue < ActiveRecord::Base | |||
|
233 | 233 | # Copies attributes from another issue, arg can be an id or an Issue |
|
234 | 234 | def copy_from(arg, options={}) |
|
235 | 235 | issue = arg.is_a?(Issue) ? arg : Issue.visible.find(arg) |
|
236 | self.attributes = issue.attributes.dup.except("id", "root_id", "parent_id", "lft", "rgt", "created_on", "updated_on") | |
|
236 | self.attributes = issue.attributes.dup.except("id", "root_id", "parent_id", "lft", "rgt", "created_on", "updated_on", "closed_on") | |
|
237 | 237 | self.custom_field_values = issue.custom_field_values.inject({}) {|h,v| h[v.custom_field_id] = v.value; h} |
|
238 | 238 | self.status = issue.status |
|
239 | 239 | self.author = User.current |
@@ -697,7 +697,7 class IssueTest < ActiveSupport::TestCase | |||
|
697 | 697 | user = User.find(2) |
|
698 | 698 | group = Group.generate! |
|
699 | 699 | group.users << user |
|
700 | ||
|
700 | ||
|
701 | 701 | issue = Issue.generate!(:author_id => 1, :assigned_to => group) |
|
702 | 702 | assert_include 4, issue.new_statuses_allowed_to(user).map(&:id) |
|
703 | 703 | end |
@@ -1268,6 +1268,16 class IssueTest < ActiveSupport::TestCase | |||
|
1268 | 1268 | end |
|
1269 | 1269 | end |
|
1270 | 1270 | |
|
1271 | def test_copy_should_clear_closed_on | |
|
1272 | copied_open = Issue.find(8).copy(:status_id => 1) | |
|
1273 | assert copied_open.save | |
|
1274 | assert_nil copied_open.closed_on | |
|
1275 | ||
|
1276 | copied_closed = Issue.find(8).copy | |
|
1277 | assert copied_closed.save | |
|
1278 | assert_not_nil copied_closed.closed_on | |
|
1279 | end | |
|
1280 | ||
|
1271 | 1281 | def test_should_not_call_after_project_change_on_creation |
|
1272 | 1282 | issue = Issue.new(:project_id => 1, :tracker_id => 1, :status_id => 1, |
|
1273 | 1283 | :subject => 'Test', :author_id => 1) |
General Comments 0
You need to be logged in to leave comments.
Login now