diff options
author | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-03-06 18:43:00 +0000 |
---|---|---|
committer | Jean-Philippe Lang <jp_lang@yahoo.fr> | 2010-03-06 18:43:00 +0000 |
commit | 6511e9423340c297c49cb54521a2fc763d625727 (patch) | |
tree | d2416d6effb08bf09927d73d6f2b38b70068cdb7 /test/functional | |
parent | 729bea1cf38ed80bc34c47a8ef3783d9e06ce5c5 (diff) | |
download | redmine-6511e9423340c297c49cb54521a2fc763d625727.tar.gz redmine-6511e9423340c297c49cb54521a2fc763d625727.zip |
Moves ProjectsController#add_issue_category to IssueCategoriesController#new.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3549 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/issue_categories_controller_test.rb | 29 | ||||
-rw-r--r-- | test/functional/projects_controller_test.rb | 12 |
2 files changed, 29 insertions, 12 deletions
diff --git a/test/functional/issue_categories_controller_test.rb b/test/functional/issue_categories_controller_test.rb index 3d1dd069a..ae5919a2f 100644 --- a/test/functional/issue_categories_controller_test.rb +++ b/test/functional/issue_categories_controller_test.rb @@ -32,6 +32,35 @@ class IssueCategoriesControllerTest < ActionController::TestCase @request.session[:user_id] = 2 end + def test_new_routing + assert_routing( + {:method => :get, :path => 'projects/test/issue_categories/new'}, + :controller => 'issue_categories', :action => 'new', :project_id => 'test' + ) + assert_routing( + {:method => :post, :path => 'projects/test/issue_categories/new'}, + :controller => 'issue_categories', :action => 'new', :project_id => 'test' + ) + end + + def test_get_new + @request.session[:user_id] = 2 # manager + get :new, :project_id => '1' + assert_response :success + assert_template 'new' + end + + def test_post_new + @request.session[:user_id] = 2 # manager + assert_difference 'IssueCategory.count' do + post :new, :project_id => '1', :category => {:name => 'New category'} + end + assert_redirected_to '/projects/ecookbook/settings/categories' + category = IssueCategory.find_by_name('New category') + assert_not_nil category + assert_equal 1, category.project_id + end + def test_post_edit assert_no_difference 'IssueCategory.count' do post :edit, :id => 2, :category => { :name => 'Testing' } diff --git a/test/functional/projects_controller_test.rb b/test/functional/projects_controller_test.rb index f4fe8dae5..e64602aee 100644 --- a/test/functional/projects_controller_test.rb +++ b/test/functional/projects_controller_test.rb @@ -329,18 +329,6 @@ class ProjectsControllerTest < ActionController::TestCase assert_equal 'Test changed name', project.name end - def test_add_issue_category_routing - assert_routing( - {:method => :get, :path => 'projects/test/categories/new'}, - :controller => 'projects', :action => 'add_issue_category', :id => 'test' - ) - assert_routing( - #TODO: use PUT and update form - {:method => :post, :path => 'projects/64/categories/new'}, - :controller => 'projects', :action => 'add_issue_category', :id => '64' - ) - end - def test_destroy_routing assert_routing( {:method => :get, :path => '/projects/567/destroy'}, |