@@ -723,9 +723,10 class Project < ActiveRecord::Base | |||
|
723 | 723 | end |
|
724 | 724 | Redmine::Hook.call_hook(:model_project_copy_before_save, :source_project => project, :destination_project => self) |
|
725 | 725 | save |
|
726 | else | |
|
727 | false | |
|
726 | 728 | end |
|
727 | 729 | end |
|
728 | true | |
|
729 | 730 | end |
|
730 | 731 | |
|
731 | 732 | # Returns a new unsaved Project instance with attributes copied from +project+ |
@@ -608,6 +608,13 class ProjectsControllerTest < ActionController::TestCase | |||
|
608 | 608 | assert_redirected_to :controller => 'projects', :action => 'settings', :id => 'unique-copy' |
|
609 | 609 | end |
|
610 | 610 | |
|
611 | def test_post_copy_with_failure | |
|
612 | @request.session[:user_id] = 1 | |
|
613 | post :copy, :id => 1, :project => {:name => 'Copy', :identifier => ''} | |
|
614 | assert_response :success | |
|
615 | assert_template 'copy' | |
|
616 | end | |
|
617 | ||
|
611 | 618 | def test_jump_should_redirect_to_active_tab |
|
612 | 619 | get :show, :id => 1, :jump => 'issues' |
|
613 | 620 | assert_redirected_to '/projects/ecookbook/issues' |
@@ -46,6 +46,11 class ProjectCopyTest < ActiveSupport::TestCase | |||
|
46 | 46 | @project.enabled_module_names = @source_project.enabled_modules.collect(&:name) |
|
47 | 47 | end |
|
48 | 48 | |
|
49 | def test_copy_should_return_false_if_save_fails | |
|
50 | project = Project.new(:name => 'Copy', :identifier => nil) | |
|
51 | assert_equal false, project.copy(@source_project) | |
|
52 | end | |
|
53 | ||
|
49 | 54 | test "#copy should copy issues" do |
|
50 | 55 | @source_project.issues << Issue.generate!(:status => IssueStatus.find_by_name('Closed'), |
|
51 | 56 | :subject => "copy issue status", |
General Comments 0
You need to be logged in to leave comments.
Login now