REST API for issue categories (#9553).

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@7882 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2011-11-20 17:09:01 +00:00
parent 6f4fb8b892
commit 34c73c7573
10 changed files with 218 additions and 27 deletions

View File

@@ -42,7 +42,7 @@ class IssueCategoriesControllerTest < ActionController::TestCase
def test_create
@request.session[:user_id] = 2 # manager
assert_difference 'IssueCategory.count' do
post :create, :project_id => '1', :category => {:name => 'New category'}
post :create, :project_id => '1', :issue_category => {:name => 'New category'}
end
assert_redirected_to '/projects/ecookbook/settings/categories'
category = IssueCategory.find_by_name('New category')
@@ -52,7 +52,7 @@ class IssueCategoriesControllerTest < ActionController::TestCase
def test_create_failure
@request.session[:user_id] = 2
post :create, :project_id => '1', :category => {:name => ''}
post :create, :project_id => '1', :issue_category => {:name => ''}
assert_response :success
assert_template 'new'
end
@@ -66,20 +66,20 @@ class IssueCategoriesControllerTest < ActionController::TestCase
def test_update
assert_no_difference 'IssueCategory.count' do
put :update, :id => 2, :category => { :name => 'Testing' }
put :update, :id => 2, :issue_category => { :name => 'Testing' }
end
assert_redirected_to '/projects/ecookbook/settings/categories'
assert_equal 'Testing', IssueCategory.find(2).name
end
def test_update_failure
put :update, :id => 2, :category => { :name => '' }
put :update, :id => 2, :issue_category => { :name => '' }
assert_response :success
assert_template 'edit'
end
def test_update_not_found
put :update, :id => 97, :category => { :name => 'Testing' }
put :update, :id => 97, :issue_category => { :name => 'Testing' }
assert_response 404
end