Isolates all API routing tests to a specific test case.

git-svn-id: http://svn.redmine.org/redmine/trunk@13604 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang
2014-11-16 10:54:33 +00:00
parent cd6b2f2268
commit eae9c9ab2b
22 changed files with 207 additions and 438 deletions

View File

@@ -132,55 +132,4 @@ class RoutingWikiTest < ActionDispatch::IntegrationTest
:id => 'ladida', :version => '3' }
)
end
def test_api
assert_routing(
{ :method => 'get', :path => "/projects/567/wiki/my_page.xml" },
{ :controller => 'wiki', :action => 'show', :project_id => '567',
:id => 'my_page', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/projects/567/wiki/my_page.json" },
{ :controller => 'wiki', :action => 'show', :project_id => '567',
:id => 'my_page', :format => 'json' }
)
assert_routing(
{ :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/2.xml" },
{ :controller => 'wiki', :action => 'show', :project_id => '1',
:id => 'CookBook_documentation', :version => '2', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/2.json" },
{ :controller => 'wiki', :action => 'show', :project_id => '1',
:id => 'CookBook_documentation', :version => '2', :format => 'json' }
)
assert_routing(
{ :method => 'get', :path => "/projects/567/wiki/index.xml" },
{ :controller => 'wiki', :action => 'index', :project_id => '567', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/projects/567/wiki/index.json" },
{ :controller => 'wiki', :action => 'index', :project_id => '567', :format => 'json' }
)
assert_routing(
{ :method => 'put', :path => "/projects/567/wiki/my_page.xml" },
{ :controller => 'wiki', :action => 'update', :project_id => '567',
:id => 'my_page', :format => 'xml' }
)
assert_routing(
{ :method => 'put', :path => "/projects/567/wiki/my_page.json" },
{ :controller => 'wiki', :action => 'update', :project_id => '567',
:id => 'my_page', :format => 'json' }
)
assert_routing(
{ :method => 'delete', :path => "/projects/567/wiki/my_page.xml" },
{ :controller => 'wiki', :action => 'destroy', :project_id => '567',
:id => 'my_page', :format => 'xml' }
)
assert_routing(
{ :method => 'delete', :path => "/projects/567/wiki/my_page.json" },
{ :controller => 'wiki', :action => 'destroy', :project_id => '567',
:id => 'my_page', :format => 'json' }
)
end
end