annotate .svn/pristine/b8/b89d65b305414155d303b1421252bad2d311e25e.svn-base @ 1519:afce8026aaeb redmine-2.4-integration

Merge from branch "live"
author Chris Cannam
date Tue, 09 Sep 2014 09:34:53 +0100
parents cbb26bc654de
children
rev   line source
Chris@909 1 # Redmine - project management software
Chris@909 2 # Copyright (C) 2006-2011 Jean-Philippe Lang
Chris@909 3 #
Chris@909 4 # This program is free software; you can redistribute it and/or
Chris@909 5 # modify it under the terms of the GNU General Public License
Chris@909 6 # as published by the Free Software Foundation; either version 2
Chris@909 7 # of the License, or (at your option) any later version.
Chris@909 8 #
Chris@909 9 # This program is distributed in the hope that it will be useful,
Chris@909 10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
Chris@909 11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Chris@909 12 # GNU General Public License for more details.
Chris@909 13 #
Chris@909 14 # You should have received a copy of the GNU General Public License
Chris@909 15 # along with this program; if not, write to the Free Software
Chris@909 16 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
Chris@909 17
Chris@909 18 require File.expand_path('../../test_helper', __FILE__)
Chris@909 19
Chris@909 20 class RoutingTest < ActionController::IntegrationTest
Chris@909 21 context "activities" do
Chris@909 22 should_route :get, "/activity", :controller => 'activities', :action => 'index', :id => nil
Chris@909 23 should_route :get, "/activity.atom", :controller => 'activities', :action => 'index', :id => nil, :format => 'atom'
Chris@909 24 end
Chris@909 25
Chris@909 26 context "attachments" do
Chris@909 27 should_route :get, "/attachments/1", :controller => 'attachments', :action => 'show', :id => '1'
Chris@909 28 should_route :get, "/attachments/1.xml", :controller => 'attachments', :action => 'show', :id => '1', :format => 'xml'
Chris@909 29 should_route :get, "/attachments/1.json", :controller => 'attachments', :action => 'show', :id => '1', :format => 'json'
Chris@909 30 should_route :get, "/attachments/1/filename.ext", :controller => 'attachments', :action => 'show', :id => '1', :filename => 'filename.ext'
Chris@909 31 should_route :get, "/attachments/download/1", :controller => 'attachments', :action => 'download', :id => '1'
Chris@909 32 should_route :get, "/attachments/download/1/filename.ext", :controller => 'attachments', :action => 'download', :id => '1', :filename => 'filename.ext'
Chris@909 33 end
Chris@909 34
Chris@909 35 context "boards" do
Chris@909 36 should_route :get, "/projects/world_domination/boards", :controller => 'boards', :action => 'index', :project_id => 'world_domination'
Chris@909 37 should_route :get, "/projects/world_domination/boards/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination'
Chris@909 38 should_route :get, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44'
Chris@909 39 should_route :get, "/projects/world_domination/boards/44.atom", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44', :format => 'atom'
Chris@909 40 should_route :get, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44'
Chris@909 41
Chris@909 42 should_route :post, "/projects/world_domination/boards/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination'
Chris@909 43 should_route :post, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44'
Chris@909 44 should_route :post, "/projects/world_domination/boards/44/destroy", :controller => 'boards', :action => 'destroy', :project_id => 'world_domination', :id => '44'
Chris@909 45
Chris@909 46 end
Chris@909 47
Chris@909 48 context "documents" do
Chris@909 49 should_route :get, "/projects/567/documents", :controller => 'documents', :action => 'index', :project_id => '567'
Chris@909 50 should_route :get, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567'
Chris@909 51 should_route :get, "/documents/22", :controller => 'documents', :action => 'show', :id => '22'
Chris@909 52 should_route :get, "/documents/22/edit", :controller => 'documents', :action => 'edit', :id => '22'
Chris@909 53
Chris@909 54 should_route :post, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567'
Chris@909 55 should_route :post, "/documents/567/edit", :controller => 'documents', :action => 'edit', :id => '567'
Chris@909 56 should_route :post, "/documents/567/destroy", :controller => 'documents', :action => 'destroy', :id => '567'
Chris@909 57 end
Chris@909 58
Chris@909 59 context "groups" do
Chris@909 60 should_route :post, "/groups/567/users", :controller => 'groups', :action => 'add_users', :id => '567'
Chris@909 61 should_route :delete, "/groups/567/users/12", :controller => 'groups', :action => 'remove_user', :id => '567', :user_id => '12'
Chris@909 62 end
Chris@909 63
Chris@909 64 context "issues" do
Chris@909 65 # REST actions
Chris@909 66 should_route :get, "/issues", :controller => 'issues', :action => 'index'
Chris@909 67 should_route :get, "/issues.pdf", :controller => 'issues', :action => 'index', :format => 'pdf'
Chris@909 68 should_route :get, "/issues.atom", :controller => 'issues', :action => 'index', :format => 'atom'
Chris@909 69 should_route :get, "/issues.xml", :controller => 'issues', :action => 'index', :format => 'xml'
Chris@909 70 should_route :get, "/projects/23/issues", :controller => 'issues', :action => 'index', :project_id => '23'
Chris@909 71 should_route :get, "/projects/23/issues.pdf", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'pdf'
Chris@909 72 should_route :get, "/projects/23/issues.atom", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'atom'
Chris@909 73 should_route :get, "/projects/23/issues.xml", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'xml'
Chris@909 74 should_route :get, "/issues/64", :controller => 'issues', :action => 'show', :id => '64'
Chris@909 75 should_route :get, "/issues/64.pdf", :controller => 'issues', :action => 'show', :id => '64', :format => 'pdf'
Chris@909 76 should_route :get, "/issues/64.atom", :controller => 'issues', :action => 'show', :id => '64', :format => 'atom'
Chris@909 77 should_route :get, "/issues/64.xml", :controller => 'issues', :action => 'show', :id => '64', :format => 'xml'
Chris@909 78
Chris@909 79 should_route :get, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23'
Chris@909 80 should_route :post, "/projects/23/issues", :controller => 'issues', :action => 'create', :project_id => '23'
Chris@909 81 should_route :post, "/issues.xml", :controller => 'issues', :action => 'create', :format => 'xml'
Chris@909 82
Chris@909 83 should_route :get, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64'
Chris@909 84 # TODO: Should use PUT
Chris@909 85 should_route :post, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64'
Chris@909 86 should_route :put, "/issues/1.xml", :controller => 'issues', :action => 'update', :id => '1', :format => 'xml'
Chris@909 87
Chris@909 88 # TODO: Should use DELETE
Chris@909 89 should_route :post, "/issues/64/destroy", :controller => 'issues', :action => 'destroy', :id => '64'
Chris@909 90 should_route :delete, "/issues/1.xml", :controller => 'issues', :action => 'destroy', :id => '1', :format => 'xml'
Chris@909 91
Chris@909 92 # Extra actions
Chris@909 93 should_route :get, "/projects/23/issues/64/copy", :controller => 'issues', :action => 'new', :project_id => '23', :copy_from => '64'
Chris@909 94
Chris@909 95 should_route :get, "/issues/move/new", :controller => 'issue_moves', :action => 'new'
Chris@909 96 should_route :post, "/issues/move", :controller => 'issue_moves', :action => 'create'
Chris@909 97
Chris@909 98 should_route :post, "/issues/1/quoted", :controller => 'journals', :action => 'new', :id => '1'
Chris@909 99
Chris@909 100 should_route :get, "/issues/calendar", :controller => 'calendars', :action => 'show'
Chris@909 101 should_route :get, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'show', :project_id => 'project-name'
Chris@909 102
Chris@909 103 should_route :get, "/issues/gantt", :controller => 'gantts', :action => 'show'
Chris@909 104 should_route :get, "/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :format => 'pdf'
Chris@909 105 should_route :get, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'show', :project_id => 'project-name'
Chris@909 106 should_route :get, "/projects/project-name/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :project_id => 'project-name', :format => 'pdf'
Chris@909 107
Chris@909 108 should_route :get, "/issues/auto_complete", :controller => 'auto_completes', :action => 'issues'
Chris@909 109
Chris@909 110 should_route :get, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123'
Chris@909 111 should_route :post, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123'
Chris@909 112 should_route :get, "/issues/context_menu", :controller => 'context_menus', :action => 'issues'
Chris@909 113 should_route :post, "/issues/context_menu", :controller => 'context_menus', :action => 'issues'
Chris@909 114
Chris@909 115 should_route :get, "/issues/changes", :controller => 'journals', :action => 'index'
Chris@909 116
Chris@909 117 should_route :get, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_edit'
Chris@909 118 should_route :post, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_update'
Chris@909 119 end
Chris@909 120
Chris@909 121 context "issue categories" do
Chris@909 122 should_route :get, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'index', :project_id => 'foo'
Chris@909 123 should_route :get, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'xml'
Chris@909 124 should_route :get, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'json'
Chris@909 125
Chris@909 126 should_route :get, "/projects/foo/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'foo'
Chris@909 127
Chris@909 128 should_route :post, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'create', :project_id => 'foo'
Chris@909 129 should_route :post, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'xml'
Chris@909 130 should_route :post, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'json'
Chris@909 131
Chris@909 132 should_route :get, "/issue_categories/1", :controller => 'issue_categories', :action => 'show', :id => '1'
Chris@909 133 should_route :get, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'xml'
Chris@909 134 should_route :get, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'json'
Chris@909 135
Chris@909 136 should_route :get, "/issue_categories/1/edit", :controller => 'issue_categories', :action => 'edit', :id => '1'
Chris@909 137
Chris@909 138 should_route :put, "/issue_categories/1", :controller => 'issue_categories', :action => 'update', :id => '1'
Chris@909 139 should_route :put, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'xml'
Chris@909 140 should_route :put, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'json'
Chris@909 141
Chris@909 142 should_route :delete, "/issue_categories/1", :controller => 'issue_categories', :action => 'destroy', :id => '1'
Chris@909 143 should_route :delete, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'xml'
Chris@909 144 should_route :delete, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'json'
Chris@909 145 end
Chris@909 146
Chris@909 147 context "issue relations" do
Chris@909 148 should_route :get, "/issues/1/relations", :controller => 'issue_relations', :action => 'index', :issue_id => '1'
Chris@909 149 should_route :get, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'xml'
Chris@909 150 should_route :get, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'json'
Chris@909 151
Chris@909 152 should_route :post, "/issues/1/relations", :controller => 'issue_relations', :action => 'create', :issue_id => '1'
Chris@909 153 should_route :post, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'xml'
Chris@909 154 should_route :post, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'json'
Chris@909 155
Chris@909 156 should_route :get, "/relations/23", :controller => 'issue_relations', :action => 'show', :id => '23'
Chris@909 157 should_route :get, "/relations/23.xml", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'xml'
Chris@909 158 should_route :get, "/relations/23.json", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'json'
Chris@909 159
Chris@909 160 should_route :delete, "/relations/23", :controller => 'issue_relations', :action => 'destroy', :id => '23'
Chris@909 161 should_route :delete, "/relations/23.xml", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'xml'
Chris@909 162 should_route :delete, "/relations/23.json", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'json'
Chris@909 163 end
Chris@909 164
Chris@909 165 context "issue reports" do
Chris@909 166 should_route :get, "/projects/567/issues/report", :controller => 'reports', :action => 'issue_report', :id => '567'
Chris@909 167 should_route :get, "/projects/567/issues/report/assigned_to", :controller => 'reports', :action => 'issue_report_details', :id => '567', :detail => 'assigned_to'
Chris@909 168 end
Chris@909 169
Chris@909 170 context "members" do
Chris@909 171 should_route :post, "/projects/5234/members/new", :controller => 'members', :action => 'new', :id => '5234'
Chris@909 172 end
Chris@909 173
Chris@909 174 context "messages" do
Chris@909 175 should_route :get, "/boards/22/topics/2", :controller => 'messages', :action => 'show', :id => '2', :board_id => '22'
Chris@909 176 should_route :get, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
Chris@909 177 should_route :get, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
Chris@909 178
Chris@909 179 should_route :post, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala'
Chris@909 180 should_route :post, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala'
Chris@909 181 should_route :post, "/boards/22/topics/555/replies", :controller => 'messages', :action => 'reply', :id => '555', :board_id => '22'
Chris@909 182 should_route :post, "/boards/22/topics/555/destroy", :controller => 'messages', :action => 'destroy', :id => '555', :board_id => '22'
Chris@909 183 end
Chris@909 184
Chris@909 185 context "news" do
Chris@909 186 should_route :get, "/news", :controller => 'news', :action => 'index'
Chris@909 187 should_route :get, "/news.atom", :controller => 'news', :action => 'index', :format => 'atom'
Chris@909 188 should_route :get, "/news.xml", :controller => 'news', :action => 'index', :format => 'xml'
Chris@909 189 should_route :get, "/news.json", :controller => 'news', :action => 'index', :format => 'json'
Chris@909 190 should_route :get, "/projects/567/news", :controller => 'news', :action => 'index', :project_id => '567'
Chris@909 191 should_route :get, "/projects/567/news.atom", :controller => 'news', :action => 'index', :format => 'atom', :project_id => '567'
Chris@909 192 should_route :get, "/projects/567/news.xml", :controller => 'news', :action => 'index', :format => 'xml', :project_id => '567'
Chris@909 193 should_route :get, "/projects/567/news.json", :controller => 'news', :action => 'index', :format => 'json', :project_id => '567'
Chris@909 194 should_route :get, "/news/2", :controller => 'news', :action => 'show', :id => '2'
Chris@909 195 should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567'
Chris@909 196 should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234'
Chris@909 197 should_route :get, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567'
Chris@909 198 should_route :get, "/news/preview", :controller => 'previews', :action => 'news'
Chris@909 199
Chris@909 200 should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567'
Chris@909 201 should_route :post, "/news/567/comments", :controller => 'comments', :action => 'create', :id => '567'
Chris@909 202
Chris@909 203 should_route :put, "/news/567", :controller => 'news', :action => 'update', :id => '567'
Chris@909 204
Chris@909 205 should_route :delete, "/news/567", :controller => 'news', :action => 'destroy', :id => '567'
Chris@909 206 should_route :delete, "/news/567/comments/15", :controller => 'comments', :action => 'destroy', :id => '567', :comment_id => '15'
Chris@909 207 end
Chris@909 208
Chris@909 209 context "projects" do
Chris@909 210 should_route :get, "/projects", :controller => 'projects', :action => 'index'
Chris@909 211 should_route :get, "/projects.atom", :controller => 'projects', :action => 'index', :format => 'atom'
Chris@909 212 should_route :get, "/projects.xml", :controller => 'projects', :action => 'index', :format => 'xml'
Chris@909 213 should_route :get, "/projects/new", :controller => 'projects', :action => 'new'
Chris@909 214 should_route :get, "/projects/test", :controller => 'projects', :action => 'show', :id => 'test'
Chris@909 215 should_route :get, "/projects/1.xml", :controller => 'projects', :action => 'show', :id => '1', :format => 'xml'
Chris@909 216 should_route :get, "/projects/4223/settings", :controller => 'projects', :action => 'settings', :id => '4223'
Chris@909 217 should_route :get, "/projects/4223/settings/members", :controller => 'projects', :action => 'settings', :id => '4223', :tab => 'members'
Chris@909 218 should_route :get, "/projects/33/files", :controller => 'files', :action => 'index', :project_id => '33'
Chris@909 219 should_route :get, "/projects/33/files/new", :controller => 'files', :action => 'new', :project_id => '33'
Chris@909 220 should_route :get, "/projects/33/roadmap", :controller => 'versions', :action => 'index', :project_id => '33'
Chris@909 221 should_route :get, "/projects/33/activity", :controller => 'activities', :action => 'index', :id => '33'
Chris@909 222 should_route :get, "/projects/33/activity.atom", :controller => 'activities', :action => 'index', :id => '33', :format => 'atom'
Chris@909 223
Chris@909 224 should_route :post, "/projects", :controller => 'projects', :action => 'create'
Chris@909 225 should_route :post, "/projects.xml", :controller => 'projects', :action => 'create', :format => 'xml'
Chris@909 226 should_route :post, "/projects/33/files", :controller => 'files', :action => 'create', :project_id => '33'
Chris@909 227 should_route :post, "/projects/64/archive", :controller => 'projects', :action => 'archive', :id => '64'
Chris@909 228 should_route :post, "/projects/64/unarchive", :controller => 'projects', :action => 'unarchive', :id => '64'
Chris@909 229
Chris@909 230 should_route :put, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'update', :project_id => '64'
Chris@909 231 should_route :put, "/projects/4223", :controller => 'projects', :action => 'update', :id => '4223'
Chris@909 232 should_route :put, "/projects/1.xml", :controller => 'projects', :action => 'update', :id => '1', :format => 'xml'
Chris@909 233
Chris@909 234 should_route :delete, "/projects/64", :controller => 'projects', :action => 'destroy', :id => '64'
Chris@909 235 should_route :delete, "/projects/1.xml", :controller => 'projects', :action => 'destroy', :id => '1', :format => 'xml'
Chris@909 236 should_route :delete, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'destroy', :project_id => '64'
Chris@909 237 end
Chris@909 238
Chris@909 239 context "queries" do
Chris@909 240 should_route :get, "/queries.xml", :controller => 'queries', :action => 'index', :format => 'xml'
Chris@909 241 should_route :get, "/queries.json", :controller => 'queries', :action => 'index', :format => 'json'
Chris@909 242
Chris@909 243 should_route :get, "/queries/new", :controller => 'queries', :action => 'new'
Chris@909 244 should_route :get, "/projects/redmine/queries/new", :controller => 'queries', :action => 'new', :project_id => 'redmine'
Chris@909 245
Chris@909 246 should_route :post, "/queries", :controller => 'queries', :action => 'create'
Chris@909 247 should_route :post, "/projects/redmine/queries", :controller => 'queries', :action => 'create', :project_id => 'redmine'
Chris@909 248
Chris@909 249 should_route :get, "/queries/1/edit", :controller => 'queries', :action => 'edit', :id => '1'
Chris@909 250
Chris@909 251 should_route :put, "/queries/1", :controller => 'queries', :action => 'update', :id => '1'
Chris@909 252
Chris@909 253 should_route :delete, "/queries/1", :controller => 'queries', :action => 'destroy', :id => '1'
Chris@909 254 end
Chris@909 255
Chris@909 256 context "repositories" do
Chris@909 257 should_route :get, "/projects/redmine/repository", :controller => 'repositories', :action => 'show', :id => 'redmine'
Chris@909 258 should_route :get, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
Chris@909 259 should_route :get, "/projects/redmine/repository/revisions", :controller => 'repositories', :action => 'revisions', :id => 'redmine'
Chris@909 260 should_route :get, "/projects/redmine/repository/revisions.atom", :controller => 'repositories', :action => 'revisions', :id => 'redmine', :format => 'atom'
Chris@909 261 should_route :get, "/projects/redmine/repository/revisions/2457", :controller => 'repositories', :action => 'revision', :id => 'redmine', :rev => '2457'
Chris@909 262 should_route :get, "/projects/redmine/repository/revisions/2457/diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457'
Chris@909 263 should_route :get, "/projects/redmine/repository/revisions/2457/diff.diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457', :format => 'diff'
Chris@909 264 should_route :get, "/projects/redmine/repository/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c]
Chris@909 265 should_route :get, "/projects/redmine/repository/revisions/2/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c], :rev => '2'
Chris@909 266 should_route :get, "/projects/redmine/repository/browse/path/to/file.c", :controller => 'repositories', :action => 'browse', :id => 'redmine', :path => %w[path to file.c]
Chris@909 267 should_route :get, "/projects/redmine/repository/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c]
Chris@909 268 should_route :get, "/projects/redmine/repository/revisions/2/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2'
Chris@909 269 should_route :get, "/projects/redmine/repository/raw/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :format => 'raw'
Chris@909 270 should_route :get, "/projects/redmine/repository/revisions/2/raw/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c], :rev => '2', :format => 'raw'
Chris@909 271 should_route :get, "/projects/redmine/repository/annotate/path/to/file.c", :controller => 'repositories', :action => 'annotate', :id => 'redmine', :path => %w[path to file.c]
Chris@909 272 should_route :get, "/projects/redmine/repository/changes/path/to/file.c", :controller => 'repositories', :action => 'changes', :id => 'redmine', :path => %w[path to file.c]
Chris@909 273 should_route :get, "/projects/redmine/repository/statistics", :controller => 'repositories', :action => 'stats', :id => 'redmine'
Chris@909 274
Chris@909 275 should_route :post, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine'
Chris@909 276 end
Chris@909 277
Chris@909 278 context "timelogs (global)" do
Chris@909 279 should_route :get, "/time_entries", :controller => 'timelog', :action => 'index'
Chris@909 280 should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'index', :format => 'csv'
Chris@909 281 should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'index', :format => 'atom'
Chris@909 282 should_route :get, "/time_entries/new", :controller => 'timelog', :action => 'new'
Chris@909 283 should_route :get, "/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22'
Chris@909 284
Chris@909 285 should_route :post, "/time_entries", :controller => 'timelog', :action => 'create'
Chris@909 286
Chris@909 287 should_route :put, "/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22'
Chris@909 288
Chris@909 289 should_route :delete, "/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55'
Chris@909 290 end
Chris@909 291
Chris@909 292 context "timelogs (scoped under project)" do
Chris@909 293 should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'index', :project_id => '567'
Chris@909 294 should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'csv'
Chris@909 295 should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'atom'
Chris@909 296 should_route :get, "/projects/567/time_entries/new", :controller => 'timelog', :action => 'new', :project_id => '567'
Chris@909 297 should_route :get, "/projects/567/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :project_id => '567'
Chris@909 298
Chris@909 299 should_route :post, "/projects/567/time_entries", :controller => 'timelog', :action => 'create', :project_id => '567'
Chris@909 300
Chris@909 301 should_route :put, "/projects/567/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :project_id => '567'
Chris@909 302
Chris@909 303 should_route :delete, "/projects/567/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :project_id => '567'
Chris@909 304 end
Chris@909 305
Chris@909 306 context "timelogs (scoped under issues)" do
Chris@909 307 should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234'
Chris@909 308 should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'csv'
Chris@909 309 should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'atom'
Chris@909 310 should_route :get, "/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234'
Chris@909 311 should_route :get, "/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234'
Chris@909 312
Chris@909 313 should_route :post, "/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234'
Chris@909 314
Chris@909 315 should_route :put, "/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234'
Chris@909 316
Chris@909 317 should_route :delete, "/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234'
Chris@909 318 end
Chris@909 319
Chris@909 320 context "timelogs (scoped under project and issues)" do
Chris@909 321 should_route :get, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook'
Chris@909 322 should_route :get, "/projects/ecookbook/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'csv'
Chris@909 323 should_route :get, "/projects/ecookbook/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'atom'
Chris@909 324 should_route :get, "/projects/ecookbook/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234', :project_id => 'ecookbook'
Chris@909 325 should_route :get, "/projects/ecookbook/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
Chris@909 326
Chris@909 327 should_route :post, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234', :project_id => 'ecookbook'
Chris@909 328
Chris@909 329 should_route :put, "/projects/ecookbook/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234', :project_id => 'ecookbook'
Chris@909 330
Chris@909 331 should_route :delete, "/projects/ecookbook/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234', :project_id => 'ecookbook'
Chris@909 332 end
Chris@909 333
Chris@909 334 context "time_entry_reports" do
Chris@909 335 should_route :get, "/time_entries/report", :controller => 'time_entry_reports', :action => 'report'
Chris@909 336 should_route :get, "/projects/567/time_entries/report", :controller => 'time_entry_reports', :action => 'report', :project_id => '567'
Chris@909 337 should_route :get, "/projects/567/time_entries/report.csv", :controller => 'time_entry_reports', :action => 'report', :project_id => '567', :format => 'csv'
Chris@909 338 end
Chris@909 339
Chris@909 340 context "users" do
Chris@909 341 should_route :get, "/users", :controller => 'users', :action => 'index'
Chris@909 342 should_route :get, "/users.xml", :controller => 'users', :action => 'index', :format => 'xml'
Chris@909 343 should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44'
Chris@909 344 should_route :get, "/users/44.xml", :controller => 'users', :action => 'show', :id => '44', :format => 'xml'
Chris@909 345 should_route :get, "/users/current", :controller => 'users', :action => 'show', :id => 'current'
Chris@909 346 should_route :get, "/users/current.xml", :controller => 'users', :action => 'show', :id => 'current', :format => 'xml'
Chris@909 347 should_route :get, "/users/new", :controller => 'users', :action => 'new'
Chris@909 348 should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444'
Chris@909 349 should_route :get, "/users/222/edit/membership", :controller => 'users', :action => 'edit', :id => '222', :tab => 'membership'
Chris@909 350
Chris@909 351 should_route :post, "/users", :controller => 'users', :action => 'create'
Chris@909 352 should_route :post, "/users.xml", :controller => 'users', :action => 'create', :format => 'xml'
Chris@909 353 should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123'
Chris@909 354 should_route :post, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55'
Chris@909 355 should_route :post, "/users/567/memberships/12/destroy", :controller => 'users', :action => 'destroy_membership', :id => '567', :membership_id => '12'
Chris@909 356
Chris@909 357 should_route :put, "/users/444", :controller => 'users', :action => 'update', :id => '444'
Chris@909 358 should_route :put, "/users/444.xml", :controller => 'users', :action => 'update', :id => '444', :format => 'xml'
Chris@909 359
Chris@909 360 should_route :delete, "/users/44", :controller => 'users', :action => 'destroy', :id => '44'
Chris@909 361 should_route :delete, "/users/44.xml", :controller => 'users', :action => 'destroy', :id => '44', :format => 'xml'
Chris@909 362 end
Chris@909 363
Chris@909 364 context "versions" do
Chris@909 365 # /projects/foo/versions is /projects/foo/roadmap
Chris@909 366 should_route :get, "/projects/foo/versions.xml", :controller => 'versions', :action => 'index', :project_id => 'foo', :format => 'xml'
Chris@909 367 should_route :get, "/projects/foo/versions.json", :controller => 'versions', :action => 'index', :project_id => 'foo', :format => 'json'
Chris@909 368
Chris@909 369 should_route :get, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo'
Chris@909 370
Chris@909 371 should_route :post, "/projects/foo/versions", :controller => 'versions', :action => 'create', :project_id => 'foo'
Chris@909 372 should_route :post, "/projects/foo/versions.xml", :controller => 'versions', :action => 'create', :project_id => 'foo', :format => 'xml'
Chris@909 373 should_route :post, "/projects/foo/versions.json", :controller => 'versions', :action => 'create', :project_id => 'foo', :format => 'json'
Chris@909 374
Chris@909 375 should_route :get, "/versions/1", :controller => 'versions', :action => 'show', :id => '1'
Chris@909 376 should_route :get, "/versions/1.xml", :controller => 'versions', :action => 'show', :id => '1', :format => 'xml'
Chris@909 377 should_route :get, "/versions/1.json", :controller => 'versions', :action => 'show', :id => '1', :format => 'json'
Chris@909 378
Chris@909 379 should_route :get, "/versions/1/edit", :controller => 'versions', :action => 'edit', :id => '1'
Chris@909 380
Chris@909 381 should_route :put, "/versions/1", :controller => 'versions', :action => 'update', :id => '1'
Chris@909 382 should_route :put, "/versions/1.xml", :controller => 'versions', :action => 'update', :id => '1', :format => 'xml'
Chris@909 383 should_route :put, "/versions/1.json", :controller => 'versions', :action => 'update', :id => '1', :format => 'json'
Chris@909 384
Chris@909 385 should_route :delete, "/versions/1", :controller => 'versions', :action => 'destroy', :id => '1'
Chris@909 386 should_route :delete, "/versions/1.xml", :controller => 'versions', :action => 'destroy', :id => '1', :format => 'xml'
Chris@909 387 should_route :delete, "/versions/1.json", :controller => 'versions', :action => 'destroy', :id => '1', :format => 'json'
Chris@909 388
Chris@909 389 should_route :put, "/projects/foo/versions/close_completed", :controller => 'versions', :action => 'close_completed', :project_id => 'foo'
Chris@909 390 should_route :post, "/versions/1/status_by", :controller => 'versions', :action => 'status_by', :id => '1'
Chris@909 391 end
Chris@909 392
Chris@909 393 context "wiki (singular, project's pages)" do
Chris@909 394 should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'show', :project_id => '567'
Chris@909 395 should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'show', :project_id => '567', :id => 'lalala'
Chris@909 396 should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :project_id => '567', :id => 'my_page'
Chris@909 397 should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :project_id => '1', :id => 'CookBook_documentation'
Chris@909 398 should_route :get, "/projects/1/wiki/CookBook_documentation/diff", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation'
Chris@909 399 should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2'
Chris@909 400 should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2/vs/1", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2', :version_from => '1'
Chris@909 401 should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :project_id => '1', :id => 'CookBook_documentation', :version => '2'
Chris@909 402 should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida'
Chris@909 403 should_route :get, "/projects/567/wiki/index", :controller => 'wiki', :action => 'index', :project_id => '567'
Chris@909 404 should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'date_index', :project_id => '567'
Chris@909 405 should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'export', :project_id => '567'
Chris@909 406
Chris@909 407 should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :project_id => '567', :id => 'CookBook_documentation'
Chris@909 408 should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida'
Chris@909 409 should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :project_id => '22', :id => 'ladida'
Chris@909 410 should_route :post, "/projects/22/wiki/ladida/add_attachment", :controller => 'wiki', :action => 'add_attachment', :project_id => '22', :id => 'ladida'
Chris@909 411
Chris@909 412 should_route :put, "/projects/567/wiki/my_page", :controller => 'wiki', :action => 'update', :project_id => '567', :id => 'my_page'
Chris@909 413
Chris@909 414 should_route :delete, "/projects/22/wiki/ladida", :controller => 'wiki', :action => 'destroy', :project_id => '22', :id => 'ladida'
Chris@909 415 end
Chris@909 416
Chris@909 417 context "wikis (plural, admin setup)" do
Chris@909 418 should_route :get, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida'
Chris@909 419
Chris@909 420 should_route :post, "/projects/ladida/wiki", :controller => 'wikis', :action => 'edit', :id => 'ladida'
Chris@909 421 should_route :post, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida'
Chris@909 422 end
Chris@909 423
Chris@909 424 context "administration panel" do
Chris@909 425 should_route :get, "/admin/projects", :controller => 'admin', :action => 'projects'
Chris@909 426 end
Chris@909 427 end