summaryrefslogtreecommitdiffstats
path: root/test/integration/routing_test.rb
diff options
context:
space:
mode:
authorToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-12-17 11:55:09 +0000
committerToshi MARUYAMA <marutosijp2@yahoo.co.jp>2011-12-17 11:55:09 +0000
commit83aad1dc04c7284b42afa6dcf92a2c1b06109886 (patch)
tree46a625b1e070cf63dcd07fb8417df48c28764960 /test/integration/routing_test.rb
parent15f4e56c9d9e92876f470eccb671257a26d92183 (diff)
downloadredmine-83aad1dc04c7284b42afa6dcf92a2c1b06109886.tar.gz
redmine-83aad1dc04c7284b42afa6dcf92a2c1b06109886.zip
test: replace "should_route" of "issue relations" to "assert_routing" at integration/routing_test.rb
git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@8257 e93f8b46-1217-0410-a6f0-8f06a7374b81
Diffstat (limited to 'test/integration/routing_test.rb')
-rw-r--r--test/integration/routing_test.rb75
1 files changed, 59 insertions, 16 deletions
diff --git a/test/integration/routing_test.rb b/test/integration/routing_test.rb
index 270c9f1bc..0d6638aa1 100644
--- a/test/integration/routing_test.rb
+++ b/test/integration/routing_test.rb
@@ -392,22 +392,65 @@ class RoutingTest < ActionController::IntegrationTest
should_route :delete, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'json'
end
- context "issue relations" do
- should_route :get, "/issues/1/relations", :controller => 'issue_relations', :action => 'index', :issue_id => '1'
- should_route :get, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'xml'
- should_route :get, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'json'
-
- should_route :post, "/issues/1/relations", :controller => 'issue_relations', :action => 'create', :issue_id => '1'
- should_route :post, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'xml'
- should_route :post, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'json'
-
- should_route :get, "/relations/23", :controller => 'issue_relations', :action => 'show', :id => '23'
- should_route :get, "/relations/23.xml", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'xml'
- should_route :get, "/relations/23.json", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'json'
-
- should_route :delete, "/relations/23", :controller => 'issue_relations', :action => 'destroy', :id => '23'
- should_route :delete, "/relations/23.xml", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'xml'
- should_route :delete, "/relations/23.json", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'json'
+ def test_issue_relations
+ assert_routing(
+ { :method => 'get', :path => "/issues/1/relations" },
+ { :controller => 'issue_relations', :action => 'index',
+ :issue_id => '1' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/issues/1/relations.xml" },
+ { :controller => 'issue_relations', :action => 'index',
+ :issue_id => '1', :format => 'xml' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/issues/1/relations.json" },
+ { :controller => 'issue_relations', :action => 'index',
+ :issue_id => '1', :format => 'json' }
+ )
+ assert_routing(
+ { :method => 'post', :path => "/issues/1/relations" },
+ { :controller => 'issue_relations', :action => 'create',
+ :issue_id => '1' }
+ )
+ assert_routing(
+ { :method => 'post', :path => "/issues/1/relations.xml" },
+ { :controller => 'issue_relations', :action => 'create',
+ :issue_id => '1', :format => 'xml' }
+ )
+ assert_routing(
+ { :method => 'post', :path => "/issues/1/relations.json" },
+ { :controller => 'issue_relations', :action => 'create',
+ :issue_id => '1', :format => 'json' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/relations/23" },
+ { :controller => 'issue_relations', :action => 'show', :id => '23' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/relations/23.xml" },
+ { :controller => 'issue_relations', :action => 'show', :id => '23',
+ :format => 'xml' }
+ )
+ assert_routing(
+ { :method => 'get', :path => "/relations/23.json" },
+ { :controller => 'issue_relations', :action => 'show', :id => '23',
+ :format => 'json' }
+ )
+ assert_routing(
+ { :method => 'delete', :path => "/relations/23" },
+ { :controller => 'issue_relations', :action => 'destroy', :id => '23' }
+ )
+ assert_routing(
+ { :method => 'delete', :path => "/relations/23.xml" },
+ { :controller => 'issue_relations', :action => 'destroy', :id => '23',
+ :format => 'xml' }
+ )
+ assert_routing(
+ { :method => 'delete', :path => "/relations/23.json" },
+ { :controller => 'issue_relations', :action => 'destroy', :id => '23',
+ :format => 'json' }
+ )
end
def test_issue_reports