@@ -117,7 +117,6 class ProjectsController < ApplicationController | |||
|
117 | 117 | Mailer.with_deliveries(params[:notifications] == '1') do |
|
118 | 118 | @project = Project.new |
|
119 | 119 | @project.safe_attributes = params[:project] |
|
120 | @project.enabled_module_names = params[:enabled_modules] | |
|
121 | 120 | if validate_parent_id && @project.copy(@source_project, :only => params[:only]) |
|
122 | 121 | @project.set_allowed_parent!(params[:project]['parent_id']) if params[:project].has_key?('parent_id') |
|
123 | 122 | flash[:notice] = l(:notice_successful_create) |
@@ -448,7 +448,7 class ProjectsControllerTest < ActionController::TestCase | |||
|
448 | 448 | end |
|
449 | 449 | end |
|
450 | 450 | |
|
451 |
def test_copy |
|
|
451 | def test_get_copy | |
|
452 | 452 | @request.session[:user_id] = 1 # admin |
|
453 | 453 | get :copy, :id => 1 |
|
454 | 454 | assert_response :success |
@@ -456,9 +456,12 class ProjectsControllerTest < ActionController::TestCase | |||
|
456 | 456 | assert assigns(:project) |
|
457 | 457 | assert_equal Project.find(1).description, assigns(:project).description |
|
458 | 458 | assert_nil assigns(:project).id |
|
459 | ||
|
460 | assert_tag :tag => 'input', | |
|
461 | :attributes => {:name => 'project[enabled_module_names][]', :value => 'issue_tracking'} | |
|
459 | 462 | end |
|
460 | 463 | |
|
461 | def test_copy_without_project | |
|
464 | def test_get_copy_without_project | |
|
462 | 465 | @request.session[:user_id] = 1 # admin |
|
463 | 466 | get :copy |
|
464 | 467 | assert_response :redirect |
@@ -475,12 +478,14 class ProjectsControllerTest < ActionController::TestCase | |||
|
475 | 478 | :name => 'Copy', |
|
476 | 479 | :identifier => 'unique-copy', |
|
477 | 480 | :tracker_ids => ['1', '2', '3', ''], |
|
478 | :enabled_modules => %w(issue_tracking time_tracking) | |
|
481 | :enabled_module_names => %w(issue_tracking time_tracking) | |
|
479 | 482 | }, |
|
480 | 483 | :only => %w(issues versions) |
|
481 | 484 | end |
|
482 | 485 | project = Project.find('unique-copy') |
|
483 | 486 | source = Project.find(1) |
|
487 | assert_equal %w(issue_tracking time_tracking), project.enabled_module_names.sort | |
|
488 | ||
|
484 | 489 | assert_equal source.versions.count, project.versions.count, "All versions were not copied" |
|
485 | 490 | # issues assigned to a closed version won't be copied |
|
486 | 491 | assert_equal source.issues.select {|i| i.fixed_version.nil? || i.fixed_version.open?}.size, |
General Comments 0
You need to be logged in to leave comments.
Login now