From fd4a91130465f6b5ae4fc937da13e8674ee4d4de Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Wed, 7 Jan 2015 22:29:50 +0000 Subject: Fixed that project copy triggers a 500 error if project validation fails. git-svn-id: http://svn.redmine.org/redmine/trunk@13848 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/unit/project_copy_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test/unit/project_copy_test.rb') diff --git a/test/unit/project_copy_test.rb b/test/unit/project_copy_test.rb index 2f1f6ee59..c10a5de15 100644 --- a/test/unit/project_copy_test.rb +++ b/test/unit/project_copy_test.rb @@ -46,6 +46,11 @@ class ProjectCopyTest < ActiveSupport::TestCase @project.enabled_module_names = @source_project.enabled_modules.collect(&:name) end + def test_copy_should_return_false_if_save_fails + project = Project.new(:name => 'Copy', :identifier => nil) + assert_equal false, project.copy(@source_project) + end + test "#copy should copy issues" do @source_project.issues << Issue.generate!(:status => IssueStatus.find_by_name('Closed'), :subject => "copy issue status", -- cgit v1.2.3