Merged r5265 from trunk.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/branches/1.1-stable@5582 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2011-04-29 07:29:23 +00:00
parent f49904569d
commit 6153d5ab83
3 changed files with 25 additions and 4 deletions
@@ -288,6 +288,22 @@ class ProjectsControllerTest < ActionController::TestCase
end
end
def test_create_should_preserve_modules_on_validation_failure
with_settings :default_projects_modules => ['issue_tracking', 'repository'] do
@request.session[:user_id] = 1
assert_no_difference 'Project.count' do
post :create, :project => {
:name => "blog",
:identifier => "",
:enabled_module_names => %w(issue_tracking news)
}
end
assert_response :success
project = assigns(:project)
assert_equal %w(issue_tracking news), project.enabled_module_names.sort
end
end
def test_create_should_not_accept_get
@request.session[:user_id] = 1
get :create