@@ -125,13 +125,13 class ProjectsController < ApplicationController | |||||
125 | if validate_parent_id && @project.copy(@source_project, :only => params[:only]) |
|
125 | if validate_parent_id && @project.copy(@source_project, :only => params[:only]) | |
126 | @project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id') |
|
126 | @project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id') | |
127 | flash[:notice] = l(:notice_successful_create) |
|
127 | flash[:notice] = l(:notice_successful_create) | |
128 |
redirect_to :controller => ' |
|
128 | redirect_to :controller => 'projects', :action => 'settings' | |
129 | elsif !@project.new_record? |
|
129 | elsif !@project.new_record? | |
130 | # Project was created |
|
130 | # Project was created | |
131 | # But some objects were not copied due to validation failures |
|
131 | # But some objects were not copied due to validation failures | |
132 | # (eg. issues from disabled trackers) |
|
132 | # (eg. issues from disabled trackers) | |
133 | # TODO: inform about that |
|
133 | # TODO: inform about that | |
134 |
redirect_to :controller => ' |
|
134 | redirect_to :controller => 'projects', :action => 'settings' | |
135 | end |
|
135 | end | |
136 | end |
|
136 | end | |
137 | end |
|
137 | end |
@@ -389,6 +389,17 class ProjectsControllerTest < ActionController::TestCase | |||||
389 | assert_redirected_to :controller => 'admin', :action => 'projects' |
|
389 | assert_redirected_to :controller => 'admin', :action => 'projects' | |
390 | end |
|
390 | end | |
391 |
|
391 | |||
|
392 | context "POST :copy" do | |||
|
393 | should "TODO: test the rest of the method" | |||
|
394 | ||||
|
395 | should "redirect to the project settings when successful" do | |||
|
396 | @request.session[:user_id] = 1 # admin | |||
|
397 | post :copy, :id => 1, :project => {:name => 'Copy', :identifier => 'unique-copy'} | |||
|
398 | assert_response :redirect | |||
|
399 | assert_redirected_to :controller => 'projects', :action => 'settings' | |||
|
400 | end | |||
|
401 | end | |||
|
402 | ||||
392 | def test_jump_should_redirect_to_active_tab |
|
403 | def test_jump_should_redirect_to_active_tab | |
393 | get :show, :id => 1, :jump => 'issues' |
|
404 | get :show, :id => 1, :jump => 'issues' | |
394 | assert_redirected_to 'projects/ecookbook/issues' |
|
405 | assert_redirected_to 'projects/ecookbook/issues' |
General Comments 0
You need to be logged in to leave comments.
Login now