From 08e309ea46f166a7d6555ddf839f86ec294fb802 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Thu, 15 Dec 2011 11:10:33 +0000 Subject: [PATCH] test: replace "should_route" of "roles" to "assert_routing" at integration/routing_test.rb git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8230 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/integration/routing_test.rb | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb index c4d7ca32c..9558a7f96 100644 --- a/test/integration/routing_test.rb +++ b/test/integration/routing_test.rb @@ -158,13 +158,31 @@ class RoutingTest < ActionController::IntegrationTest ) end - context "roles" do - should_route :get, "/enumerations", :controller => 'enumerations', :action => 'index' - should_route :get, "/enumerations/new", :controller => 'enumerations', :action => 'new' - should_route :post, "/enumerations", :controller => 'enumerations', :action => 'create' - should_route :get, "/enumerations/2/edit", :controller => 'enumerations', :action => 'edit', :id => 2 - should_route :put, "/enumerations/2", :controller => 'enumerations', :action => 'update', :id => 2 - should_route :delete, "/enumerations/2", :controller => 'enumerations', :action => 'destroy', :id => 2 + def test_roles + assert_routing( + { :method => 'get', :path => "/enumerations" }, + { :controller => 'enumerations', :action => 'index' } + ) + assert_routing( + { :method => 'get', :path => "/enumerations/new" }, + { :controller => 'enumerations', :action => 'new' } + ) + assert_routing( + { :method => 'post', :path => "/enumerations" }, + { :controller => 'enumerations', :action => 'create' } + ) + assert_routing( + { :method => 'get', :path => "/enumerations/2/edit" }, + { :controller => 'enumerations', :action => 'edit', :id => '2' } + ) + assert_routing( + { :method => 'put', :path => "/enumerations/2" }, + { :controller => 'enumerations', :action => 'update', :id => '2' } + ) + assert_routing( + { :method => 'delete', :path => "/enumerations/2" }, + { :controller => 'enumerations', :action => 'destroy', :id => '2' } + ) end def test_groups