diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-01-06 20:57:17 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2011-01-06 20:57:17 +0000 |
commit | 9222cf91eab448a2f5177f4ce6b40924f0df252c (patch) | |
tree | cde523d89e47a229028466c91f97986ebb107320 /test/functional/projects_controller_test.rb | |
parent | 072c4ad14cf0649545ceab6261558a32c234e720 (diff) | |
download | redmine-9222cf91eab448a2f5177f4ce6b40924f0df252c.tar.gz redmine-9222cf91eab448a2f5177f4ce6b40924f0df252c.zip |
Changes ProjectsController#modules param name and add tests.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4647 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional/projects_controller_test.rb')
-rw-r--r-- | test/functional/projects_controller_test.rb | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index 0b77daa50..fefb8d53b 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -288,15 +288,10 @@ class ProjectsControllerTest < ActionController::TestCase end end - context "GET :create" do - setup do - @request.session[:user_id] = 1 - end - - should "not be allowed" do - get :create - assert_response :method_not_allowed - end + def test_create_should_not_accept_get + @request.session[:user_id] = 1 + get :create + assert_response :method_not_allowed end def test_show_by_id @@ -376,6 +371,21 @@ class ProjectsControllerTest < ActionController::TestCase project = Project.find(1) assert_equal 'Test changed name', project.name end + + def test_modules + @request.session[:user_id] = 2 + Project.find(1).enabled_module_names = ['issue_tracking', 'news'] + + post :modules, :id => 1, :enabled_module_names => ['issue_tracking', 'repository', 'documents'] + assert_redirected_to '/projects/ecookbook/settings/modules' + assert_equal ['documents', 'issue_tracking', 'repository'], Project.find(1).enabled_module_names.sort + end + + def test_modules_should_not_allow_get + @request.session[:user_id] = 1 + get :modules, :id => 1 + assert_response :method_not_allowed + end def test_get_destroy @request.session[:user_id] = 1 # admin |