summaryrefslogtreecommitdiffstats
path: root/test/functional
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2011-04-29 07:26:45 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2011-04-29 07:26:45 +0000
commitfab9aca747d83375f2b6f4876075104372d9947f (patch)
treece6438ab4cd30b90fcad5f42ee0e1e7f40e45680 /test/functional
parent02c5577a26b19b551817017f140f47f377dc10c4 (diff)
downloadredmine-fab9aca747d83375f2b6f4876075104372d9947f.tar.gz
redmine-fab9aca747d83375f2b6f4876075104372d9947f.zip
Fixed: selected modules are not activated when copying a project (#8244).
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@5581 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r--test/functional/projects_controller_test.rb11
1 files changed, 8 insertions, 3 deletions
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb
index 3d00b8634..cb42cad03 100644
--- a/test/functional/projects_controller_test.rb
+++ b/test/functional/projects_controller_test.rb
@@ -448,7 +448,7 @@ class ProjectsControllerTest < ActionController::TestCase
end
end
- def test_copy_with_project
+ def test_get_copy
@request.session[:user_id] = 1 # admin
get :copy, :id => 1
assert_response :success
@@ -456,9 +456,12 @@ class ProjectsControllerTest < ActionController::TestCase
assert assigns(:project)
assert_equal Project.find(1).description, assigns(:project).description
assert_nil assigns(:project).id
+
+ assert_tag :tag => 'input',
+ :attributes => {:name => 'project[enabled_module_names][]', :value => 'issue_tracking'}
end
- def test_copy_without_project
+ def test_get_copy_without_project
@request.session[:user_id] = 1 # admin
get :copy
assert_response :redirect
@@ -475,12 +478,14 @@ class ProjectsControllerTest < ActionController::TestCase
:name => 'Copy',
:identifier => 'unique-copy',
:tracker_ids => ['1', '2', '3', ''],
- :enabled_modules => %w(issue_tracking time_tracking)
+ :enabled_module_names => %w(issue_tracking time_tracking)
},
:only => %w(issues versions)
end
project = Project.find('unique-copy')
source = Project.find(1)
+ assert_equal %w(issue_tracking time_tracking), project.enabled_module_names.sort
+
assert_equal source.versions.count, project.versions.count, "All versions were not copied"
# issues assigned to a closed version won't be copied
assert_equal source.issues.select {|i| i.fixed_version.nil? || i.fixed_version.open?}.size,