diff options
author | Eric Davis <edavis@littlestreamsoftware.com> | 2010-09-26 22:33:33 +0000 |
---|---|---|
committer | Eric Davis <edavis@littlestreamsoftware.com> | 2010-09-26 22:33:33 +0000 |
commit | 98eaff414f12b80d4cd0e336cf6852e4e3248b00 (patch) | |
tree | 97a10a4bb6f4da3b52157d3a1fcf350ac2d575fc | |
parent | eb05880717bc96f864395a1c7a1bb2aaa0ed0efe (diff) | |
download | redmine-98eaff414f12b80d4cd0e336cf6852e4e3248b00.tar.gz redmine-98eaff414f12b80d4cd0e336cf6852e4e3248b00.zip |
Merged r4185 from trunk.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.0-stable@4203 e93f8b46-1217-0410-a6f0-8f06a7374b81
-rw-r--r-- | app/controllers/projects_controller.rb | 4 | ||||
-rw-r--r-- | test/functional/projects_controller_test.rb | 11 |
2 files changed, 13 insertions, 2 deletions
diff --git a/app/controllers/projects_controller.rb b/app/controllers/projects_controller.rb index f16349329..c3efbfd9f 100644 --- a/app/controllers/projects_controller.rb +++ b/app/controllers/projects_controller.rb @@ -125,13 +125,13 @@ class ProjectsController < ApplicationController if validate_parent_id && @project.copy(@source_project, :only => params[:only]) @project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id') flash[:notice] = l(:notice_successful_create) - redirect_to :controller => 'admin', :action => 'projects' + redirect_to :controller => 'projects', :action => 'settings' elsif !@project.new_record? # Project was created # But some objects were not copied due to validation failures # (eg. issues from disabled trackers) # TODO: inform about that - redirect_to :controller => 'admin', :action => 'projects' + redirect_to :controller => 'projects', :action => 'settings' end end end diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index 636cb1751..8a9bbe6d5 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -389,6 +389,17 @@ class ProjectsControllerTest < ActionController::TestCase assert_redirected_to :controller => 'admin', :action => 'projects' end + context "POST :copy" do + should "TODO: test the rest of the method" + + should "redirect to the project settings when successful" do + @request.session[:user_id] = 1 # admin + post :copy, :id => 1, :project => {:name => 'Copy', :identifier => 'unique-copy'} + assert_response :redirect + assert_redirected_to :controller => 'projects', :action => 'settings' + end + end + def test_jump_should_redirect_to_active_tab get :show, :id => 1, :jump => 'issues' assert_redirected_to 'projects/ecookbook/issues' |