summaryrefslogtreecommitdiffstats
path: root/test/functional/projects_controller_test.rb
diff options
context:
space:
mode:
authorJean-Philippe Lang <jp_lang@yahoo.fr>2009-11-15 13:22:08 +0000
committerJean-Philippe Lang <jp_lang@yahoo.fr>2009-11-15 13:22:08 +0000
commit534ce51154c55078a611a098b225b6d0c9f8653f (patch)
tree11c49f42d856092734a3e0c9a9cf3f7219168a12 /test/functional/projects_controller_test.rb
parentea9a7c20e66032a79f07b197090aedfb97c5bef6 (diff)
downloadredmine-534ce51154c55078a611a098b225b6d0c9f8653f.tar.gz
redmine-534ce51154c55078a611a098b225b6d0c9f8653f.zip
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
Diffstat (limited to 'test/functional/projects_controller_test.rb')
-rw-r--r--test/functional/projects_controller_test.rb17
1 files changed, 17 insertions, 0 deletions
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