summaryrefslogtreecommitdiffstats
path: root/test/functional/projects_controller_test.rb
diff options
context:
space:
mode:
authorEric Davis <edavis@littlestreamsoftware.com>2009-05-03 21:25:37 +0000
committerEric Davis <edavis@littlestreamsoftware.com>2009-05-03 21:25:37 +0000
commitfa7bd1c71dca1e9c74e6d83277336321393dac9f (patch)
tree4f1adac8a535ae7424887ea21f6171a22eb698ea /test/functional/projects_controller_test.rb
parent29c0dae1518ecb8a86d10da8e05caf70f731d746 (diff)
downloadredmine-fa7bd1c71dca1e9c74e6d83277336321393dac9f.tar.gz
redmine-fa7bd1c71dca1e9c74e6d83277336321393dac9f.zip
Added the ability to copy a project in the Project Administration panel.
* Added Copy project button. * Added Project#copy_from to duplicate a project to be modified and saved by the user * Added a ProjectsController#copy based off the add method ** Used Project#copy_from to create a duplicate project in memory * Implemented Project#copy to copy data for a project from another and save it. ** Members ** Project level queries ** Project custom fields * Added a plugin hook for Project#copy. #1125 #1556 #886 #309 git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@2704 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/projects_controller_test.rb')
-rw-r--r--test/functional/projects_controller_test.rb20
1 files changed, 18 insertions, 2 deletions
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb
index 1aded6429..4393ac075 100644
--- a/test/functional/projects_controller_test.rb
+++ b/test/functional/projects_controller_test.rb
@@ -453,7 +453,6 @@ class ProjectsControllerTest < Test::Unit::TestCase
6.times do |i|
p = Project.create!(:name => "Breadcrumbs #{i}", :identifier => "breadcrumbs-#{i}")
p.set_parent!(parent)
-
get :show, :id => p
assert_tag :h1, :parent => { :attributes => {:id => 'header'}},
:children => { :count => [i, 3].min,
@@ -462,7 +461,24 @@ class ProjectsControllerTest < Test::Unit::TestCase
parent = p
end
end
-
+
+ def test_copy_with_project
+ @request.session[:user_id] = 1 # admin
+ get :copy, :id => 1
+ assert_response :success
+ assert_template 'copy'
+ assert assigns(:project)
+ assert_equal Project.find(1).description, assigns(:project).description
+ assert_nil assigns(:project).id
+ end
+
+ def test_copy_without_project
+ @request.session[:user_id] = 1 # admin
+ get :copy
+ assert_response :redirect
+ assert_redirected_to :controller => 'admin', :action => 'projects'
+ end
+
def test_jump_should_redirect_to_active_tab
get :show, :id => 1, :jump => 'issues'
assert_redirected_to 'projects/ecookbook/issues'