Fixed: Issues associated with a locked version are not copied when copying a project (#11207).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@10334 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2012-09-09 10:11:49 +00:00
parent 5e9320137b
commit ff86c37ed3
2 changed files with 32 additions and 1 deletions
+21
View File
@@ -823,6 +823,27 @@ class ProjectTest < ActiveSupport::TestCase
assert_equal "Closed", copied_issue.status.name
end
should "copy issues assigned to a locked version" do
User.current = User.find(1)
assigned_version = Version.generate!(:name => "Assigned Issues")
@source_project.versions << assigned_version
Issue.generate_for_project!(@source_project,
:fixed_version_id => assigned_version.id,
:subject => "copy issues assigned to a locked version",
:tracker_id => 1,
:project_id => @source_project.id)
assigned_version.update_attribute :status, 'locked'
assert @project.copy(@source_project)
@project.reload
copied_issue = @project.issues.first(:conditions => {:subject => "copy issues assigned to a locked version"})
assert copied_issue
assert copied_issue.fixed_version
assert_equal "Assigned Issues", copied_issue.fixed_version.name # Same name
assert_equal 'locked', copied_issue.fixed_version.status
end
should "change the new issues to use the copied version" do
User.current = User.find(1)
assigned_version = Version.generate!(:name => "Assigned Issues", :status => 'open')