From 534ce51154c55078a611a098b225b6d0c9f8653f Mon Sep 17 00:00:00 2001 From: Jean-Philippe Lang Date: Sun, 15 Nov 2009 13:22:08 +0000 Subject: Allow non admin users to add subprojects (#2963). Subprojects can be added to the projects for which the user has add_project permission. git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3059 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/functional/projects_controller_test.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) (limited to 'test/functional/projects_controller_test.rb') diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index dcbcb77eb..6704d4fa8 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -117,6 +117,23 @@ class ProjectsControllerTest < ActionController::TestCase assert_kind_of Project, project assert_equal 'weblog', project.description assert_equal true, project.is_public? + assert_nil project.parent + end + + def test_post_add_subproject + @request.session[:user_id] = 1 + post :add, :project => { :name => "blog", + :description => "weblog", + :identifier => "blog", + :is_public => 1, + :custom_field_values => { '3' => 'Beta' }, + :parent_id => 1 + } + assert_redirected_to '/projects/blog/settings' + + project = Project.find_by_name('blog') + assert_kind_of Project, project + assert_equal Project.find(1), project.parent end def test_post_add_by_non_admin -- cgit v1.2.3