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:
Jean-Philippe Lang
2014-11-16 14:23:32 +00:00
parent d72e1f95ba
commit ecda1c7a4f
46 changed files with 539 additions and 1808 deletions

View File

@@ -17,24 +17,15 @@
require File.expand_path('../../../test_helper', __FILE__)
class RoutingActivitiesTest < ActionDispatch::IntegrationTest
def test_activities
assert_routing(
{ :method => 'get', :path => "/activity" },
{ :controller => 'activities', :action => 'index' }
)
assert_routing(
{ :method => 'get', :path => "/activity.atom" },
{ :controller => 'activities', :action => 'index', :format => 'atom' }
)
assert_routing(
{ :method => 'get', :path => "/projects/33/activity" },
{ :controller => 'activities', :action => 'index', :id => '33' }
)
assert_routing(
{ :method => 'get', :path => "/projects/33/activity.atom" },
{ :controller => 'activities', :action => 'index', :id => '33',
:format => 'atom' }
)
class RoutingActivitiesTest < Redmine::RoutingTest
def test_activity
should_route 'GET /activity' => 'activities#index'
should_route 'GET /activity.atom' => 'activities#index', :format => 'atom'
end
def test_project_activity
should_route 'GET /projects/33/activity' => 'activities#index', :id => '33'
should_route 'GET /projects/33/activity.atom' => 'activities#index', :id => '33', :format => 'atom'
end
end