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
This commit is contained in:
Jean-Philippe Lang
2009-11-15 13:22:08 +00:00
parent ea9a7c20e6
commit 534ce51154
6 changed files with 66 additions and 12 deletions
@@ -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