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
This commit is contained in:
1 parent
729bea1cf3
commit
6511e94233
9 files changed
+75
-49
No files matched your search
@@ -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' }
|
||||
|
||||
@@ -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'},
|
||||
|
||||
Reference in new issue
Block a user