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

@@ -23,14 +23,6 @@ class RoutingAttachmentsTest < ActionDispatch::IntegrationTest
{ :method => 'get', :path => "/attachments/1" },
{ :controller => 'attachments', :action => 'show', :id => '1' }
)
assert_routing(
{ :method => 'get', :path => "/attachments/1.xml" },
{ :controller => 'attachments', :action => 'show', :id => '1', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/attachments/1.json" },
{ :controller => 'attachments', :action => 'show', :id => '1', :format => 'json' }
)
assert_routing(
{ :method => 'get', :path => "/attachments/1/filename.ext" },
{ :controller => 'attachments', :action => 'show', :id => '1',
@@ -57,13 +49,5 @@ class RoutingAttachmentsTest < ActionDispatch::IntegrationTest
{ :method => 'delete', :path => "/attachments/1" },
{ :controller => 'attachments', :action => 'destroy', :id => '1' }
)
assert_routing(
{ :method => 'post', :path => '/uploads.xml' },
{ :controller => 'attachments', :action => 'upload', :format => 'xml' }
)
assert_routing(
{ :method => 'post', :path => '/uploads.json' },
{ :controller => 'attachments', :action => 'upload', :format => 'json' }
)
end
end

View File

@@ -44,11 +44,4 @@ class RoutingCustomFieldsTest < ActionDispatch::IntegrationTest
{ :controller => 'custom_fields', :action => 'destroy', :id => '2' }
)
end
def test_custom_fields_api
assert_routing(
{ :method => 'get', :path => "/custom_fields.xml" },
{ :controller => 'custom_fields', :action => 'index', :format => 'xml' }
)
end
end

View File

@@ -43,9 +43,5 @@ class RoutingEnumerationsTest < ActionDispatch::IntegrationTest
{ :method => 'delete', :path => "/enumerations/2" },
{ :controller => 'enumerations', :action => 'destroy', :id => '2' }
)
assert_routing(
{ :method => 'get', :path => "/enumerations/issue_priorities.xml" },
{ :controller => 'enumerations', :action => 'index', :type => 'issue_priorities', :format => 'xml' }
)
end
end

View File

@@ -23,18 +23,10 @@ class RoutingGroupsTest < ActionDispatch::IntegrationTest
{ :method => 'get', :path => "/groups" },
{ :controller => 'groups', :action => 'index' }
)
assert_routing(
{ :method => 'get', :path => "/groups.xml" },
{ :controller => 'groups', :action => 'index', :format => 'xml' }
)
assert_routing(
{ :method => 'post', :path => "/groups" },
{ :controller => 'groups', :action => 'create' }
)
assert_routing(
{ :method => 'post', :path => "/groups.xml" },
{ :controller => 'groups', :action => 'create', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/groups/new" },
{ :controller => 'groups', :action => 'new' }
@@ -55,26 +47,14 @@ class RoutingGroupsTest < ActionDispatch::IntegrationTest
{ :method => 'get', :path => "/groups/1" },
{ :controller => 'groups', :action => 'show', :id => '1' }
)
assert_routing(
{ :method => 'get', :path => "/groups/1.xml" },
{ :controller => 'groups', :action => 'show', :id => '1', :format => 'xml' }
)
assert_routing(
{ :method => 'put', :path => "/groups/1" },
{ :controller => 'groups', :action => 'update', :id => '1' }
)
assert_routing(
{ :method => 'put', :path => "/groups/1.xml" },
{ :controller => 'groups', :action => 'update', :id => '1', :format => 'xml' }
)
assert_routing(
{ :method => 'delete', :path => "/groups/1" },
{ :controller => 'groups', :action => 'destroy', :id => '1' }
)
assert_routing(
{ :method => 'delete', :path => "/groups/1.xml" },
{ :controller => 'groups', :action => 'destroy', :id => '1', :format => 'xml' }
)
end
def test_groups
@@ -86,17 +66,9 @@ class RoutingGroupsTest < ActionDispatch::IntegrationTest
{ :method => 'post', :path => "/groups/567/users" },
{ :controller => 'groups', :action => 'add_users', :id => '567' }
)
assert_routing(
{ :method => 'post', :path => "/groups/567/users.xml" },
{ :controller => 'groups', :action => 'add_users', :id => '567', :format => 'xml' }
)
assert_routing(
{ :method => 'delete', :path => "/groups/567/users/12" },
{ :controller => 'groups', :action => 'remove_user', :id => '567', :user_id => '12' }
)
assert_routing(
{ :method => 'delete', :path => "/groups/567/users/12.xml" },
{ :controller => 'groups', :action => 'remove_user', :id => '567', :user_id => '12', :format => 'xml' }
)
end
end

View File

@@ -24,16 +24,6 @@ class RoutingIssueCategoriesTest < ActionDispatch::IntegrationTest
{ :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',
@@ -44,16 +34,6 @@ class RoutingIssueCategoriesTest < ActionDispatch::IntegrationTest
{ :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' }
)
end
def test_issue_categories
@@ -61,16 +41,6 @@ class RoutingIssueCategoriesTest < ActionDispatch::IntegrationTest
{ :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' }
@@ -79,29 +49,9 @@ class RoutingIssueCategoriesTest < ActionDispatch::IntegrationTest
{ :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
end

View File

@@ -24,58 +24,18 @@ class RoutingIssueRelationsTest < ActionDispatch::IntegrationTest
{ :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
end

View File

@@ -23,26 +23,14 @@ class RoutingIssueStatusesTest < ActionDispatch::IntegrationTest
{ :method => 'get', :path => "/issue_statuses" },
{ :controller => 'issue_statuses', :action => 'index' }
)
assert_routing(
{ :method => 'get', :path => "/issue_statuses.xml" },
{ :controller => 'issue_statuses', :action => 'index', :format => 'xml' }
)
assert_routing(
{ :method => 'post', :path => "/issue_statuses" },
{ :controller => 'issue_statuses', :action => 'create' }
)
assert_routing(
{ :method => 'post', :path => "/issue_statuses.xml" },
{ :controller => 'issue_statuses', :action => 'create', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/issue_statuses/new" },
{ :controller => 'issue_statuses', :action => 'new' }
)
assert_routing(
{ :method => 'get', :path => "/issue_statuses/new.xml" },
{ :controller => 'issue_statuses', :action => 'new', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/issue_statuses/1/edit" },
{ :controller => 'issue_statuses', :action => 'edit', :id => '1' }
@@ -52,29 +40,14 @@ class RoutingIssueStatusesTest < ActionDispatch::IntegrationTest
{ :controller => 'issue_statuses', :action => 'update',
:id => '1' }
)
assert_routing(
{ :method => 'put', :path => "/issue_statuses/1.xml" },
{ :controller => 'issue_statuses', :action => 'update',
:format => 'xml', :id => '1' }
)
assert_routing(
{ :method => 'delete', :path => "/issue_statuses/1" },
{ :controller => 'issue_statuses', :action => 'destroy',
:id => '1' }
)
assert_routing(
{ :method => 'delete', :path => "/issue_statuses/1.xml" },
{ :controller => 'issue_statuses', :action => 'destroy',
:format => 'xml', :id => '1' }
)
assert_routing(
{ :method => 'post', :path => "/issue_statuses/update_issue_done_ratio" },
{ :controller => 'issue_statuses', :action => 'update_issue_done_ratio' }
)
assert_routing(
{ :method => 'post', :path => "/issue_statuses/update_issue_done_ratio.xml" },
{ :controller => 'issue_statuses', :action => 'update_issue_done_ratio',
:format => 'xml' }
)
end
end

View File

@@ -18,7 +18,7 @@
require File.expand_path('../../../test_helper', __FILE__)
class RoutingIssuesTest < ActionDispatch::IntegrationTest
def test_issues_rest_actions
def test_issues
assert_routing(
{ :method => 'get', :path => "/issues" },
{ :controller => 'issues', :action => 'index' }
@@ -31,10 +31,6 @@ class RoutingIssuesTest < ActionDispatch::IntegrationTest
{ :method => 'get', :path => "/issues.atom" },
{ :controller => 'issues', :action => 'index', :format => 'atom' }
)
assert_routing(
{ :method => 'get', :path => "/issues.xml" },
{ :controller => 'issues', :action => 'index', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/issues/64" },
{ :controller => 'issues', :action => 'show', :id => '64' }
@@ -49,32 +45,21 @@ class RoutingIssuesTest < ActionDispatch::IntegrationTest
{ :controller => 'issues', :action => 'show', :id => '64',
:format => 'atom' }
)
assert_routing(
{ :method => 'get', :path => "/issues/64.xml" },
{ :controller => 'issues', :action => 'show', :id => '64',
:format => 'xml' }
)
assert_routing(
{ :method => 'post', :path => "/issues.xml" },
{ :controller => 'issues', :action => 'create', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/issues/64/edit" },
{ :controller => 'issues', :action => 'edit', :id => '64' }
)
assert_routing(
{ :method => 'put', :path => "/issues/1.xml" },
{ :controller => 'issues', :action => 'update', :id => '1',
:format => 'xml' }
{ :method => 'put', :path => "/issues/1" },
{ :controller => 'issues', :action => 'update', :id => '1' }
)
assert_routing(
{ :method => 'delete', :path => "/issues/1.xml" },
{ :controller => 'issues', :action => 'destroy', :id => '1',
:format => 'xml' }
{ :method => 'delete', :path => "/issues/1" },
{ :controller => 'issues', :action => 'destroy', :id => '1' }
)
end
def test_issues_rest_actions_scoped_under_project
def test_issues_scoped_under_project
assert_routing(
{ :method => 'get', :path => "/projects/23/issues" },
{ :controller => 'issues', :action => 'index', :project_id => '23' }
@@ -89,11 +74,6 @@ class RoutingIssuesTest < ActionDispatch::IntegrationTest
{ :controller => 'issues', :action => 'index', :project_id => '23',
:format => 'atom' }
)
assert_routing(
{ :method => 'get', :path => "/projects/23/issues.xml" },
{ :controller => 'issues', :action => 'index', :project_id => '23',
:format => 'xml' }
)
assert_routing(
{ :method => 'post', :path => "/projects/23/issues" },
{ :controller => 'issues', :action => 'create', :project_id => '23' }

View File

@@ -19,22 +19,10 @@ require File.expand_path('../../../test_helper', __FILE__)
class RoutingMembersTest < ActionDispatch::IntegrationTest
def test_members
assert_routing(
{ :method => 'get', :path => "/projects/5234/memberships.xml" },
{ :controller => 'members', :action => 'index', :project_id => '5234', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/memberships/5234.xml" },
{ :controller => 'members', :action => 'show', :id => '5234', :format => 'xml' }
)
assert_routing(
{ :method => 'post', :path => "/projects/5234/memberships" },
{ :controller => 'members', :action => 'create', :project_id => '5234' }
)
assert_routing(
{ :method => 'post', :path => "/projects/5234/memberships.xml" },
{ :controller => 'members', :action => 'create', :project_id => '5234', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/projects/5234/memberships/new" },
{ :controller => 'members', :action => 'new', :project_id => '5234' }
@@ -43,18 +31,10 @@ class RoutingMembersTest < ActionDispatch::IntegrationTest
{ :method => 'put', :path => "/memberships/5234" },
{ :controller => 'members', :action => 'update', :id => '5234' }
)
assert_routing(
{ :method => 'put', :path => "/memberships/5234.xml" },
{ :controller => 'members', :action => 'update', :id => '5234', :format => 'xml' }
)
assert_routing(
{ :method => 'delete', :path => "/memberships/5234" },
{ :controller => 'members', :action => 'destroy', :id => '5234' }
)
assert_routing(
{ :method => 'delete', :path => "/memberships/5234.xml" },
{ :controller => 'members', :action => 'destroy', :id => '5234', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/projects/5234/memberships/autocomplete" },
{ :controller => 'members', :action => 'autocomplete', :project_id => '5234' }

View File

@@ -27,14 +27,6 @@ class RoutingNewsTest < ActionDispatch::IntegrationTest
{ :method => 'get', :path => "/news.atom" },
{ :controller => 'news', :action => 'index', :format => 'atom' }
)
assert_routing(
{ :method => 'get', :path => "/news.xml" },
{ :controller => 'news', :action => 'index', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/news.json" },
{ :controller => 'news', :action => 'index', :format => 'json' }
)
end
def test_news
@@ -70,16 +62,6 @@ class RoutingNewsTest < ActionDispatch::IntegrationTest
{ :controller => 'news', :action => 'index', :format => 'atom',
:project_id => '567' }
)
assert_routing(
{ :method => 'get', :path => "/projects/567/news.xml" },
{ :controller => 'news', :action => 'index', :format => 'xml',
:project_id => '567' }
)
assert_routing(
{ :method => 'get', :path => "/projects/567/news.json" },
{ :controller => 'news', :action => 'index', :format => 'json',
:project_id => '567' }
)
assert_routing(
{ :method => 'get', :path => "/projects/567/news/new" },
{ :controller => 'news', :action => 'new', :project_id => '567' }

View File

@@ -27,10 +27,6 @@ class RoutingProjectsTest < ActionDispatch::IntegrationTest
{ :method => 'get', :path => "/projects.atom" },
{ :controller => 'projects', :action => 'index', :format => 'atom' }
)
assert_routing(
{ :method => 'get', :path => "/projects.xml" },
{ :controller => 'projects', :action => 'index', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/projects/new" },
{ :controller => 'projects', :action => 'new' }
@@ -39,11 +35,6 @@ class RoutingProjectsTest < ActionDispatch::IntegrationTest
{ :method => 'get', :path => "/projects/test" },
{ :controller => 'projects', :action => 'show', :id => 'test' }
)
assert_routing(
{ :method => 'get', :path => "/projects/1.xml" },
{ :controller => 'projects', :action => 'show', :id => '1',
:format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/projects/4223/settings" },
{ :controller => 'projects', :action => 'settings', :id => '4223' }
@@ -57,10 +48,6 @@ class RoutingProjectsTest < ActionDispatch::IntegrationTest
{ :method => 'post', :path => "/projects" },
{ :controller => 'projects', :action => 'create' }
)
assert_routing(
{ :method => 'post', :path => "/projects.xml" },
{ :controller => 'projects', :action => 'create', :format => 'xml' }
)
assert_routing(
{ :method => 'post', :path => "/projects/64/archive" },
{ :controller => 'projects', :action => 'archive', :id => '64' }
@@ -81,19 +68,9 @@ class RoutingProjectsTest < ActionDispatch::IntegrationTest
{ :method => 'put', :path => "/projects/4223" },
{ :controller => 'projects', :action => 'update', :id => '4223' }
)
assert_routing(
{ :method => 'put', :path => "/projects/1.xml" },
{ :controller => 'projects', :action => 'update', :id => '1',
:format => 'xml' }
)
assert_routing(
{ :method => 'delete', :path => "/projects/64" },
{ :controller => 'projects', :action => 'destroy', :id => '64' }
)
assert_routing(
{ :method => 'delete', :path => "/projects/1.xml" },
{ :controller => 'projects', :action => 'destroy', :id => '1',
:format => 'xml' }
)
end
end

View File

@@ -19,14 +19,6 @@ require File.expand_path('../../../test_helper', __FILE__)
class RoutingQueriesTest < ActionDispatch::IntegrationTest
def test_queries
assert_routing(
{ :method => 'get', :path => "/queries.xml" },
{ :controller => 'queries', :action => 'index', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/queries.json" },
{ :controller => 'queries', :action => 'index', :format => 'json' }
)
assert_routing(
{ :method => 'get', :path => "/queries/new" },
{ :controller => 'queries', :action => 'new' }

View File

@@ -23,14 +23,6 @@ class RoutingRolesTest < ActionDispatch::IntegrationTest
{ :method => 'get', :path => "/roles" },
{ :controller => 'roles', :action => 'index' }
)
assert_routing(
{ :method => 'get', :path => "/roles.xml" },
{ :controller => 'roles', :action => 'index', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/roles/2.xml" },
{ :controller => 'roles', :action => 'show', :id => '2', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/roles/new" },
{ :controller => 'roles', :action => 'new' }

View File

@@ -23,26 +23,14 @@ class RoutingTrackersTest < ActionDispatch::IntegrationTest
{ :method => 'get', :path => "/trackers" },
{ :controller => 'trackers', :action => 'index' }
)
assert_routing(
{ :method => 'get', :path => "/trackers.xml" },
{ :controller => 'trackers', :action => 'index', :format => 'xml' }
)
assert_routing(
{ :method => 'post', :path => "/trackers" },
{ :controller => 'trackers', :action => 'create' }
)
assert_routing(
{ :method => 'post', :path => "/trackers.xml" },
{ :controller => 'trackers', :action => 'create', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/trackers/new" },
{ :controller => 'trackers', :action => 'new' }
)
assert_routing(
{ :method => 'get', :path => "/trackers/new.xml" },
{ :controller => 'trackers', :action => 'new', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/trackers/1/edit" },
{ :controller => 'trackers', :action => 'edit', :id => '1' }
@@ -52,21 +40,11 @@ class RoutingTrackersTest < ActionDispatch::IntegrationTest
{ :controller => 'trackers', :action => 'update',
:id => '1' }
)
assert_routing(
{ :method => 'put', :path => "/trackers/1.xml" },
{ :controller => 'trackers', :action => 'update',
:format => 'xml', :id => '1' }
)
assert_routing(
{ :method => 'delete', :path => "/trackers/1" },
{ :controller => 'trackers', :action => 'destroy',
:id => '1' }
)
assert_routing(
{ :method => 'delete', :path => "/trackers/1.xml" },
{ :controller => 'trackers', :action => 'destroy',
:format => 'xml', :id => '1' }
)
assert_routing(
{ :method => 'get', :path => "/trackers/fields" },
{ :controller => 'trackers', :action => 'fields' }

View File

@@ -23,28 +23,14 @@ class RoutingUsersTest < ActionDispatch::IntegrationTest
{ :method => 'get', :path => "/users" },
{ :controller => 'users', :action => 'index' }
)
assert_routing(
{ :method => 'get', :path => "/users.xml" },
{ :controller => 'users', :action => 'index', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/users/44" },
{ :controller => 'users', :action => 'show', :id => '44' }
)
assert_routing(
{ :method => 'get', :path => "/users/44.xml" },
{ :controller => 'users', :action => 'show', :id => '44',
:format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/users/current" },
{ :controller => 'users', :action => 'show', :id => 'current' }
)
assert_routing(
{ :method => 'get', :path => "/users/current.xml" },
{ :controller => 'users', :action => 'show', :id => 'current',
:format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/users/new" },
{ :controller => 'users', :action => 'new' }
@@ -57,27 +43,13 @@ class RoutingUsersTest < ActionDispatch::IntegrationTest
{ :method => 'post', :path => "/users" },
{ :controller => 'users', :action => 'create' }
)
assert_routing(
{ :method => 'post', :path => "/users.xml" },
{ :controller => 'users', :action => 'create', :format => 'xml' }
)
assert_routing(
{ :method => 'put', :path => "/users/444" },
{ :controller => 'users', :action => 'update', :id => '444' }
)
assert_routing(
{ :method => 'put', :path => "/users/444.xml" },
{ :controller => 'users', :action => 'update', :id => '444',
:format => 'xml' }
)
assert_routing(
{ :method => 'delete', :path => "/users/44" },
{ :controller => 'users', :action => 'destroy', :id => '44' }
)
assert_routing(
{ :method => 'delete', :path => "/users/44.xml" },
{ :controller => 'users', :action => 'destroy', :id => '44',
:format => 'xml' }
)
end
end

View File

@@ -32,16 +32,6 @@ class RoutingVersionsTest < ActionDispatch::IntegrationTest
{ :controller => 'versions', :action => 'close_completed',
:project_id => 'foo' }
)
assert_routing(
{ :method => 'get', :path => "/projects/foo/versions.xml" },
{ :controller => 'versions', :action => 'index',
:project_id => 'foo', :format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/projects/foo/versions.json" },
{ :controller => 'versions', :action => 'index',
:project_id => 'foo', :format => 'json' }
)
assert_routing(
{ :method => 'get', :path => "/projects/foo/versions/new" },
{ :controller => 'versions', :action => 'new',
@@ -52,16 +42,6 @@ class RoutingVersionsTest < ActionDispatch::IntegrationTest
{ :controller => 'versions', :action => 'create',
:project_id => 'foo' }
)
assert_routing(
{ :method => 'post', :path => "/projects/foo/versions.xml" },
{ :controller => 'versions', :action => 'create',
:project_id => 'foo', :format => 'xml' }
)
assert_routing(
{ :method => 'post', :path => "/projects/foo/versions.json" },
{ :controller => 'versions', :action => 'create',
:project_id => 'foo', :format => 'json' }
)
end
def test_versions
@@ -69,16 +49,6 @@ class RoutingVersionsTest < ActionDispatch::IntegrationTest
{ :method => 'get', :path => "/versions/1" },
{ :controller => 'versions', :action => 'show', :id => '1' }
)
assert_routing(
{ :method => 'get', :path => "/versions/1.xml" },
{ :controller => 'versions', :action => 'show', :id => '1',
:format => 'xml' }
)
assert_routing(
{ :method => 'get', :path => "/versions/1.json" },
{ :controller => 'versions', :action => 'show', :id => '1',
:format => 'json' }
)
assert_routing(
{ :method => 'get', :path => "/versions/1/edit" },
{ :controller => 'versions', :action => 'edit', :id => '1' }
@@ -87,30 +57,10 @@ class RoutingVersionsTest < ActionDispatch::IntegrationTest
{ :method => 'put', :path => "/versions/1" },
{ :controller => 'versions', :action => 'update', :id => '1' }
)
assert_routing(
{ :method => 'put', :path => "/versions/1.xml" },
{ :controller => 'versions', :action => 'update', :id => '1',
:format => 'xml' }
)
assert_routing(
{ :method => 'put', :path => "/versions/1.json" },
{ :controller => 'versions', :action => 'update', :id => '1',
:format => 'json' }
)
assert_routing(
{ :method => 'delete', :path => "/versions/1" },
{ :controller => 'versions', :action => 'destroy', :id => '1' }
)
assert_routing(
{ :method => 'delete', :path => "/versions/1.xml" },
{ :controller => 'versions', :action => 'destroy', :id => '1',
:format => 'xml' }
)
assert_routing(
{ :method => 'delete', :path => "/versions/1.json" },
{ :controller => 'versions', :action => 'destroy', :id => '1',
:format => 'json' }
)
assert_routing(
{ :method => 'post', :path => "/versions/1/status_by" },
{ :controller => 'versions', :action => 'status_by', :id => '1' }

View File

@@ -47,15 +47,5 @@ class RoutingWatchersTest < ActionDispatch::IntegrationTest
{ :method => 'delete', :path => "/watchers/watch" },
{ :controller => 'watchers', :action => 'unwatch' }
)
assert_routing(
{ :method => 'post', :path => "/issues/12/watchers.xml" },
{ :controller => 'watchers', :action => 'create',
:object_type => 'issue', :object_id => '12', :format => 'xml' }
)
assert_routing(
{ :method => 'delete', :path => "/issues/12/watchers/3.xml" },
{ :controller => 'watchers', :action => 'destroy',
:object_type => 'issue', :object_id => '12', :user_id => '3', :format => 'xml'}
)
end
end

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