mirror of
https://github.com/redmine/redmine.git
synced 2025-11-10 07:16:03 +01:00
Use should_route in routing tests.
git-svn-id: http://svn.redmine.org/redmine/trunk@13608 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -17,50 +17,17 @@
|
||||
|
||||
require File.expand_path('../../../test_helper', __FILE__)
|
||||
|
||||
class RoutingMessagesTest < ActionDispatch::IntegrationTest
|
||||
class RoutingMessagesTest < Redmine::RoutingTest
|
||||
def test_messages
|
||||
assert_routing(
|
||||
{ :method => 'get', :path => "/boards/22/topics/2" },
|
||||
{ :controller => 'messages', :action => 'show', :id => '2',
|
||||
:board_id => '22' }
|
||||
)
|
||||
assert_routing(
|
||||
{ :method => 'get', :path => "/boards/lala/topics/new" },
|
||||
{ :controller => 'messages', :action => 'new', :board_id => 'lala' }
|
||||
)
|
||||
assert_routing(
|
||||
{ :method => 'get', :path => "/boards/lala/topics/22/edit" },
|
||||
{ :controller => 'messages', :action => 'edit', :id => '22',
|
||||
:board_id => 'lala' }
|
||||
)
|
||||
assert_routing(
|
||||
{ :method => 'post', :path => "/boards/lala/topics/quote/22" },
|
||||
{ :controller => 'messages', :action => 'quote', :id => '22',
|
||||
:board_id => 'lala' }
|
||||
)
|
||||
assert_routing(
|
||||
{ :method => 'post', :path => "/boards/lala/topics/new" },
|
||||
{ :controller => 'messages', :action => 'new', :board_id => 'lala' }
|
||||
)
|
||||
assert_routing(
|
||||
{ :method => 'post', :path => "/boards/lala/topics/preview" },
|
||||
{ :controller => 'messages', :action => 'preview',
|
||||
:board_id => 'lala' }
|
||||
)
|
||||
assert_routing(
|
||||
{ :method => 'post', :path => "/boards/lala/topics/22/edit" },
|
||||
{ :controller => 'messages', :action => 'edit', :id => '22',
|
||||
:board_id => 'lala' }
|
||||
)
|
||||
assert_routing(
|
||||
{ :method => 'post', :path => "/boards/22/topics/555/replies" },
|
||||
{ :controller => 'messages', :action => 'reply', :id => '555',
|
||||
:board_id => '22' }
|
||||
)
|
||||
assert_routing(
|
||||
{ :method => 'post', :path => "/boards/22/topics/555/destroy" },
|
||||
{ :controller => 'messages', :action => 'destroy', :id => '555',
|
||||
:board_id => '22' }
|
||||
)
|
||||
# TODO: refactor routes
|
||||
should_route 'GET /boards/22/topics/new' => 'messages#new', :board_id => '22'
|
||||
should_route 'POST /boards/22/topics/new' => 'messages#new', :board_id => '22'
|
||||
should_route 'POST /boards/22/topics/preview' => 'messages#preview', :board_id => '22'
|
||||
|
||||
should_route 'GET /boards/22/topics/2' => 'messages#show', :id => '2', :board_id => '22'
|
||||
should_route 'GET /boards/22/topics/2/edit' => 'messages#edit', :id => '2', :board_id => '22'
|
||||
should_route 'POST /boards/22/topics/quote/2' => 'messages#quote', :id => '2', :board_id => '22'
|
||||
should_route 'POST /boards/22/topics/2/replies' => 'messages#reply', :id => '2', :board_id => '22'
|
||||
should_route 'POST /boards/22/topics/2/destroy' => 'messages#destroy', :id => '2', :board_id => '22'
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user