From 08c4b229886898aa72cb33362eb06c7ad177c207 Mon Sep 17 00:00:00 2001 From: Toshi MARUYAMA Date: Sun, 18 Dec 2011 08:12:40 +0000 Subject: [PATCH] test: replace "should_route" of "issue categories" to "assert_routing" at integration/routing_test.rb git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8273 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- test/integration/routing_test.rb | 106 ++++++++++++++++++++++++------- 1 file changed, 82 insertions(+), 24 deletions(-) diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb index cb2f17d56..28558f18d 100644 --- a/test/integration/routing_test.rb +++ b/test/integration/routing_test.rb @@ -366,30 +366,88 @@ class RoutingTest < ActionController::IntegrationTest ) end - context "issue categories" do - should_route :get, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'index', :project_id => 'foo' - should_route :get, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'xml' - should_route :get, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'json' - - should_route :get, "/projects/foo/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'foo' - - should_route :post, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'create', :project_id => 'foo' - should_route :post, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'xml' - should_route :post, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'json' - - should_route :get, "/issue_categories/1", :controller => 'issue_categories', :action => 'show', :id => '1' - should_route :get, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'xml' - should_route :get, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'json' - - should_route :get, "/issue_categories/1/edit", :controller => 'issue_categories', :action => 'edit', :id => '1' - - should_route :put, "/issue_categories/1", :controller => 'issue_categories', :action => 'update', :id => '1' - should_route :put, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'xml' - should_route :put, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'json' - - should_route :delete, "/issue_categories/1", :controller => 'issue_categories', :action => 'destroy', :id => '1' - should_route :delete, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'xml' - should_route :delete, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'json' + def test_issue_categories + assert_routing( + { :method => 'get', :path => "/projects/foo/issue_categories" }, + { :controller => 'issue_categories', :action => 'index', + :project_id => 'foo' } + ) + assert_routing( + { :method => 'get', :path => "/projects/foo/issue_categories.xml" }, + { :controller => 'issue_categories', :action => 'index', + :project_id => 'foo', :format => 'xml' } + ) + assert_routing( + { :method => 'get', :path => "/projects/foo/issue_categories.json" }, + { :controller => 'issue_categories', :action => 'index', + :project_id => 'foo', :format => 'json' } + ) + assert_routing( + { :method => 'get', :path => "/projects/foo/issue_categories/new" }, + { :controller => 'issue_categories', :action => 'new', + :project_id => 'foo' } + ) + assert_routing( + { :method => 'post', :path => "/projects/foo/issue_categories" }, + { :controller => 'issue_categories', :action => 'create', + :project_id => 'foo' } + ) + assert_routing( + { :method => 'post', :path => "/projects/foo/issue_categories.xml" }, + { :controller => 'issue_categories', :action => 'create', + :project_id => 'foo', :format => 'xml' } + ) + assert_routing( + { :method => 'post', :path => "/projects/foo/issue_categories.json" }, + { :controller => 'issue_categories', :action => 'create', + :project_id => 'foo', :format => 'json' } + ) + assert_routing( + { :method => 'get', :path => "/issue_categories/1" }, + { :controller => 'issue_categories', :action => 'show', :id => '1' } + ) + assert_routing( + { :method => 'get', :path => "/issue_categories/1.xml" }, + { :controller => 'issue_categories', :action => 'show', :id => '1', + :format => 'xml' } + ) + assert_routing( + { :method => 'get', :path => "/issue_categories/1.json" }, + { :controller => 'issue_categories', :action => 'show', :id => '1', + :format => 'json' } + ) + assert_routing( + { :method => 'get', :path => "/issue_categories/1/edit" }, + { :controller => 'issue_categories', :action => 'edit', :id => '1' } + ) + assert_routing( + { :method => 'put', :path => "/issue_categories/1" }, + { :controller => 'issue_categories', :action => 'update', :id => '1' } + ) + assert_routing( + { :method => 'put', :path => "/issue_categories/1.xml" }, + { :controller => 'issue_categories', :action => 'update', :id => '1', + :format => 'xml' } + ) + assert_routing( + { :method => 'put', :path => "/issue_categories/1.json" }, + { :controller => 'issue_categories', :action => 'update', :id => '1', + :format => 'json' } + ) + assert_routing( + { :method => 'delete', :path => "/issue_categories/1" }, + { :controller => 'issue_categories', :action => 'destroy', :id => '1' } + ) + assert_routing( + { :method => 'delete', :path => "/issue_categories/1.xml" }, + { :controller => 'issue_categories', :action => 'destroy', :id => '1', + :format => 'xml' } + ) + assert_routing( + { :method => 'delete', :path => "/issue_categories/1.json" }, + { :controller => 'issue_categories', :action => 'destroy', :id => '1', + :format => 'json' } + ) end def test_issue_relations