Refactor: Move the rest of the routing tests to RoutingTest.
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@3687 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -31,13 +31,6 @@ class BoardsControllerTest < ActionController::TestCase
|
||||
User.current = nil
|
||||
end
|
||||
|
||||
def test_index_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/world_domination/boards'},
|
||||
:controller => 'boards', :action => 'index', :project_id => 'world_domination'
|
||||
)
|
||||
end
|
||||
|
||||
def test_index
|
||||
get :index, :project_id => 1
|
||||
assert_response :success
|
||||
@@ -60,17 +53,6 @@ class BoardsControllerTest < ActionController::TestCase
|
||||
assert_not_nil assigns(:topics)
|
||||
end
|
||||
|
||||
def test_new_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/world_domination/boards/new'},
|
||||
:controller => 'boards', :action => 'new', :project_id => 'world_domination'
|
||||
)
|
||||
assert_recognizes(
|
||||
{:controller => 'boards', :action => 'new', :project_id => 'world_domination'},
|
||||
{:method => :post, :path => '/projects/world_domination/boards'}
|
||||
)
|
||||
end
|
||||
|
||||
def test_post_new
|
||||
@request.session[:user_id] = 2
|
||||
assert_difference 'Board.count' do
|
||||
@@ -79,17 +61,6 @@ class BoardsControllerTest < ActionController::TestCase
|
||||
assert_redirected_to '/projects/ecookbook/settings/boards'
|
||||
end
|
||||
|
||||
def test_show_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/world_domination/boards/44'},
|
||||
:controller => 'boards', :action => 'show', :id => '44', :project_id => 'world_domination'
|
||||
)
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/world_domination/boards/44.atom'},
|
||||
:controller => 'boards', :action => 'show', :id => '44', :project_id => 'world_domination', :format => 'atom'
|
||||
)
|
||||
end
|
||||
|
||||
def test_show
|
||||
get :show, :project_id => 1, :id => 1
|
||||
assert_response :success
|
||||
@@ -108,17 +79,6 @@ class BoardsControllerTest < ActionController::TestCase
|
||||
assert_not_nil assigns(:messages)
|
||||
end
|
||||
|
||||
def test_edit_routing
|
||||
assert_routing(
|
||||
{:method => :get, :path => '/projects/world_domination/boards/44/edit'},
|
||||
:controller => 'boards', :action => 'edit', :id => '44', :project_id => 'world_domination'
|
||||
)
|
||||
assert_recognizes(#TODO: use PUT method to board_path, modify form accordingly
|
||||
{:controller => 'boards', :action => 'edit', :id => '44', :project_id => 'world_domination'},
|
||||
{:method => :post, :path => '/projects/world_domination/boards/44/edit'}
|
||||
)
|
||||
end
|
||||
|
||||
def test_post_edit
|
||||
@request.session[:user_id] = 2
|
||||
assert_no_difference 'Board.count' do
|
||||
@@ -128,13 +88,6 @@ class BoardsControllerTest < ActionController::TestCase
|
||||
assert_equal 'Testing', Board.find(2).name
|
||||
end
|
||||
|
||||
def test_destroy_routing
|
||||
assert_routing(#TODO: use DELETE method to board_path, modify form accoringly
|
||||
{:method => :post, :path => '/projects/world_domination/boards/44/destroy'},
|
||||
:controller => 'boards', :action => 'destroy', :id => '44', :project_id => 'world_domination'
|
||||
)
|
||||
end
|
||||
|
||||
def test_post_destroy
|
||||
@request.session[:user_id] = 2
|
||||
assert_difference 'Board.count', -1 do
|
||||
|
||||
Reference in New Issue
Block a user