diff options
author | Go MAEDA <maeda@farend.jp> | 2018-05-13 08:49:18 +0000 |
---|---|---|
committer | Go MAEDA <maeda@farend.jp> | 2018-05-13 08:49:18 +0000 |
commit | 45478883a42482c409805cbba802f559c42895b8 (patch) | |
tree | 222fac20bed6165ef911e5d2465b5d2a6f9c81af /test/unit/project_copy_test.rb | |
parent | c2c2a9c9f7c991565bc7314cecbb0efe43e46449 (diff) | |
download | redmine-45478883a42482c409805cbba802f559c42895b8.tar.gz redmine-45478883a42482c409805cbba802f559c42895b8.zip |
Copy project attachments (#26622).
Patch by Holger Just.
git-svn-id: http://svn.redmine.org/redmine/trunk@17333 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/unit/project_copy_test.rb')
-rw-r--r-- | test/unit/project_copy_test.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/unit/project_copy_test.rb b/test/unit/project_copy_test.rb index 9352c0d04..05d5d2e4d 100644 --- a/test/unit/project_copy_test.rb +++ b/test/unit/project_copy_test.rb @@ -51,6 +51,14 @@ class ProjectCopyTest < ActiveSupport::TestCase assert_equal false, project.copy(@source_project) end + test "#copy should copy project attachments" do + Attachment.create!(:container => @source_project, :file => uploaded_test_file("testfile.txt", "text/plain"), :author_id => 1) + assert @project.copy(@source_project) + + assert_equal 1, @project.attachments.count, "Attachment not copied" + assert_equal "testfile.txt", @project.attachments.first.filename + end + test "#copy should copy issues" do @source_project.issues << Issue.generate!(:status => IssueStatus.find_by_name('Closed'), :subject => "copy issue status", |