summaryrefslogtreecommitdiffstats
path: root/test/unit/project_test.rb
diff options
context:
space:
mode:
Diffstat (limited to 'test/unit/project_test.rb')
-rw-r--r--test/unit/project_test.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/unit/project_test.rb b/test/unit/project_test.rb
index 39c0e8ab0..b3fd3de24 100644
--- a/test/unit/project_test.rb
+++ b/test/unit/project_test.rb
@@ -870,6 +870,18 @@ class ProjectTest < ActiveSupport::TestCase
assert_not_equal source_relation_cross_project.id, copied_relation.id
end
+ should "copy issue attachments" do
+ issue = Issue.generate!(:subject => "copy with attachment", :tracker_id => 1, :project_id => @source_project.id)
+ Attachment.create!(:container => issue, :file => uploaded_test_file("testfile.txt", "text/plain"), :author_id => 1)
+ @source_project.issues << issue
+ assert @project.copy(@source_project)
+
+ copied_issue = @project.issues.first(:conditions => {:subject => "copy with attachment"})
+ assert_not_nil copied_issue
+ assert_equal 1, copied_issue.attachments.count, "Attachment not copied"
+ assert_equal "testfile.txt", copied_issue.attachments.first.filename
+ end
+
should "copy memberships" do
assert @project.valid?
assert @project.members.empty?