@@ -1,205 +1,203 | |||
|
1 | 1 | ActionController::Routing::Routes.draw do |map| |
|
2 | 2 | # Add your own custom routes here. |
|
3 | 3 | # The priority is based upon order of creation: first created -> highest priority. |
|
4 | 4 | |
|
5 | 5 | # Here's a sample route: |
|
6 | 6 | # map.connect 'products/:id', :controller => 'catalog', :action => 'view' |
|
7 | 7 | # Keep in mind you can assign values other than :controller and :action |
|
8 | 8 | |
|
9 | 9 | map.home '', :controller => 'welcome' |
|
10 | 10 | |
|
11 | 11 | map.signin 'login', :controller => 'account', :action => 'login' |
|
12 | 12 | map.signout 'logout', :controller => 'account', :action => 'logout' |
|
13 | 13 | |
|
14 | 14 | map.connect 'roles/workflow/:id/:role_id/:tracker_id', :controller => 'roles', :action => 'workflow' |
|
15 | 15 | map.connect 'help/:ctrl/:page', :controller => 'help' |
|
16 | 16 | |
|
17 | 17 | map.time_entries_context_menu '/time_entries/context_menu', |
|
18 | 18 | :controller => 'context_menus', :action => 'time_entries' |
|
19 | 19 | |
|
20 | 20 | map.resources :time_entries, :controller => 'timelog', :collection => {:report => :get, :bulk_edit => :get, :bulk_update => :post} |
|
21 | 21 | |
|
22 | 22 | map.connect 'projects/:id/wiki', :controller => 'wikis', :action => 'edit', :conditions => {:method => :post} |
|
23 | 23 | map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :get} |
|
24 | 24 | map.connect 'projects/:id/wiki/destroy', :controller => 'wikis', :action => 'destroy', :conditions => {:method => :post} |
|
25 | 25 | |
|
26 | 26 | map.with_options :controller => 'messages' do |messages_routes| |
|
27 | 27 | messages_routes.with_options :conditions => {:method => :get} do |messages_views| |
|
28 | 28 | messages_views.connect 'boards/:board_id/topics/new', :action => 'new' |
|
29 | 29 | messages_views.connect 'boards/:board_id/topics/:id', :action => 'show' |
|
30 | 30 | messages_views.connect 'boards/:board_id/topics/:id/edit', :action => 'edit' |
|
31 | 31 | end |
|
32 | 32 | messages_routes.with_options :conditions => {:method => :post} do |messages_actions| |
|
33 | 33 | messages_actions.connect 'boards/:board_id/topics/new', :action => 'new' |
|
34 | 34 | messages_actions.connect 'boards/:board_id/topics/:id/replies', :action => 'reply' |
|
35 | 35 | messages_actions.connect 'boards/:board_id/topics/:id/:action', :action => /edit|destroy/ |
|
36 | 36 | end |
|
37 | 37 | end |
|
38 | 38 | |
|
39 | 39 | map.resources :issue_moves, :only => [:new, :create], :path_prefix => '/issues', :as => 'move' |
|
40 | 40 | map.resources :queries, :except => [:show] |
|
41 | 41 | |
|
42 | 42 | # Misc issue routes. TODO: move into resources |
|
43 | 43 | map.auto_complete_issues '/issues/auto_complete', :controller => 'auto_completes', :action => 'issues', :conditions => { :method => :get } |
|
44 | 44 | map.preview_issue '/issues/preview/:id', :controller => 'previews', :action => 'issue' # TODO: would look nicer as /issues/:id/preview |
|
45 | 45 | map.issues_context_menu '/issues/context_menu', :controller => 'context_menus', :action => 'issues' |
|
46 | 46 | map.issue_changes '/issues/changes', :controller => 'journals', :action => 'index' |
|
47 | map.bulk_edit_issue 'issues/bulk_edit', :controller => 'issues', :action => 'bulk_edit', :conditions => { :method => :get } | |
|
48 | map.bulk_update_issue 'issues/bulk_edit', :controller => 'issues', :action => 'bulk_update', :conditions => { :method => :post } | |
|
49 | 47 | map.quoted_issue '/issues/:id/quoted', :controller => 'journals', :action => 'new', :id => /\d+/, :conditions => { :method => :post } |
|
50 | 48 | map.connect '/issues/:id/destroy', :controller => 'issues', :action => 'destroy', :conditions => { :method => :post } # legacy |
|
51 | 49 | |
|
52 | 50 | map.with_options :controller => 'gantts', :action => 'show' do |gantts_routes| |
|
53 | 51 | gantts_routes.connect '/projects/:project_id/issues/gantt' |
|
54 | 52 | gantts_routes.connect '/projects/:project_id/issues/gantt.:format' |
|
55 | 53 | gantts_routes.connect '/issues/gantt.:format' |
|
56 | 54 | end |
|
57 | 55 | |
|
58 | 56 | map.with_options :controller => 'calendars', :action => 'show' do |calendars_routes| |
|
59 | 57 | calendars_routes.connect '/projects/:project_id/issues/calendar' |
|
60 | 58 | calendars_routes.connect '/issues/calendar' |
|
61 | 59 | end |
|
62 | 60 | |
|
63 | 61 | map.with_options :controller => 'reports', :conditions => {:method => :get} do |reports| |
|
64 | 62 | reports.connect 'projects/:id/issues/report', :action => 'issue_report' |
|
65 | 63 | reports.connect 'projects/:id/issues/report/:detail', :action => 'issue_report_details' |
|
66 | 64 | end |
|
67 | 65 | |
|
68 | map.resources :issues do |issues| | |
|
66 | map.resources :issues, :collection => {:bulk_edit => :get, :bulk_update => :post} do |issues| | |
|
69 | 67 | issues.resources :time_entries, :controller => 'timelog', :collection => {:report => :get} |
|
70 | 68 | issues.resources :relations, :shallow => true, :controller => 'issue_relations', :only => [:index, :show, :create, :destroy] |
|
71 | 69 | end |
|
72 | 70 | |
|
73 | 71 | map.connect 'projects/:id/members/new', :controller => 'members', :action => 'new' |
|
74 | 72 | |
|
75 | 73 | map.resources :users |
|
76 | 74 | map.with_options :controller => 'users' do |users| |
|
77 | 75 | users.user_memberships 'users/:id/memberships', :action => 'edit_membership', :conditions => {:method => :post} |
|
78 | 76 | users.user_membership 'users/:id/memberships/:membership_id', :action => 'edit_membership', :conditions => {:method => :put} |
|
79 | 77 | users.connect 'users/:id/memberships/:membership_id', :action => 'destroy_membership', :conditions => {:method => :delete} |
|
80 | 78 | end |
|
81 | 79 | |
|
82 | 80 | # For nice "roadmap" in the url for the index action |
|
83 | 81 | map.connect 'projects/:project_id/roadmap', :controller => 'versions', :action => 'index' |
|
84 | 82 | |
|
85 | 83 | map.all_news 'news', :controller => 'news', :action => 'index' |
|
86 | 84 | map.formatted_all_news 'news.:format', :controller => 'news', :action => 'index' |
|
87 | 85 | map.preview_news '/news/preview', :controller => 'previews', :action => 'news' |
|
88 | 86 | map.connect 'news/:id/comments', :controller => 'comments', :action => 'create', :conditions => {:method => :post} |
|
89 | 87 | map.connect 'news/:id/comments/:comment_id', :controller => 'comments', :action => 'destroy', :conditions => {:method => :delete} |
|
90 | 88 | |
|
91 | 89 | map.resources :projects, :member => { |
|
92 | 90 | :copy => [:get, :post], |
|
93 | 91 | :settings => :get, |
|
94 | 92 | :modules => :post, |
|
95 | 93 | :archive => :post, |
|
96 | 94 | :unarchive => :post |
|
97 | 95 | } do |project| |
|
98 | 96 | project.resource :project_enumerations, :as => 'enumerations', :only => [:update, :destroy] |
|
99 | 97 | project.resources :issues, :only => [:index, :new, :create] do |issues| |
|
100 | 98 | issues.resources :time_entries, :controller => 'timelog', :collection => {:report => :get} |
|
101 | 99 | end |
|
102 | 100 | project.resources :files, :only => [:index, :new, :create] |
|
103 | 101 | project.resources :versions, :shallow => true, :collection => {:close_completed => :put}, :member => {:status_by => :post} |
|
104 | 102 | project.resources :news, :shallow => true |
|
105 | 103 | project.resources :time_entries, :controller => 'timelog', :path_prefix => 'projects/:project_id', :collection => {:report => :get} |
|
106 | 104 | project.resources :queries, :only => [:new, :create] |
|
107 | 105 | project.resources :issue_categories, :shallow => true |
|
108 | 106 | project.resources :documents, :shallow => true, :member => {:add_attachment => :post} |
|
109 | 107 | project.resources :boards |
|
110 | 108 | |
|
111 | 109 | project.wiki_start_page 'wiki', :controller => 'wiki', :action => 'show', :conditions => {:method => :get} |
|
112 | 110 | project.wiki_index 'wiki/index', :controller => 'wiki', :action => 'index', :conditions => {:method => :get} |
|
113 | 111 | project.wiki_diff 'wiki/:id/diff/:version', :controller => 'wiki', :action => 'diff', :version => nil |
|
114 | 112 | project.wiki_diff 'wiki/:id/diff/:version/vs/:version_from', :controller => 'wiki', :action => 'diff' |
|
115 | 113 | project.wiki_annotate 'wiki/:id/annotate/:version', :controller => 'wiki', :action => 'annotate' |
|
116 | 114 | project.resources :wiki, :except => [:new, :create], :member => { |
|
117 | 115 | :rename => [:get, :post], |
|
118 | 116 | :history => :get, |
|
119 | 117 | :preview => :any, |
|
120 | 118 | :protect => :post, |
|
121 | 119 | :add_attachment => :post |
|
122 | 120 | }, :collection => { |
|
123 | 121 | :export => :get, |
|
124 | 122 | :date_index => :get |
|
125 | 123 | } |
|
126 | 124 | |
|
127 | 125 | end |
|
128 | 126 | |
|
129 | 127 | # Destroy uses a get request to prompt the user before the actual DELETE request |
|
130 | 128 | map.project_destroy_confirm 'projects/:id/destroy', :controller => 'projects', :action => 'destroy', :conditions => {:method => :get} |
|
131 | 129 | |
|
132 | 130 | # TODO: port to be part of the resources route(s) |
|
133 | 131 | map.with_options :controller => 'projects' do |project_mapper| |
|
134 | 132 | project_mapper.with_options :conditions => {:method => :get} do |project_views| |
|
135 | 133 | project_views.connect 'projects/:id/settings/:tab', :controller => 'projects', :action => 'settings' |
|
136 | 134 | project_views.connect 'projects/:project_id/issues/:copy_from/copy', :controller => 'issues', :action => 'new' |
|
137 | 135 | end |
|
138 | 136 | end |
|
139 | 137 | |
|
140 | 138 | map.with_options :controller => 'activities', :action => 'index', :conditions => {:method => :get} do |activity| |
|
141 | 139 | activity.connect 'projects/:id/activity' |
|
142 | 140 | activity.connect 'projects/:id/activity.:format' |
|
143 | 141 | activity.connect 'activity', :id => nil |
|
144 | 142 | activity.connect 'activity.:format', :id => nil |
|
145 | 143 | end |
|
146 | 144 | |
|
147 | 145 | map.with_options :controller => 'repositories' do |repositories| |
|
148 | 146 | repositories.with_options :conditions => {:method => :get} do |repository_views| |
|
149 | 147 | repository_views.connect 'projects/:id/repository', :action => 'show' |
|
150 | 148 | repository_views.connect 'projects/:id/repository/edit', :action => 'edit' |
|
151 | 149 | repository_views.connect 'projects/:id/repository/statistics', :action => 'stats' |
|
152 | 150 | repository_views.connect 'projects/:id/repository/revisions', :action => 'revisions' |
|
153 | 151 | repository_views.connect 'projects/:id/repository/revisions.:format', :action => 'revisions' |
|
154 | 152 | repository_views.connect 'projects/:id/repository/revisions/:rev', :action => 'revision' |
|
155 | 153 | repository_views.connect 'projects/:id/repository/revisions/:rev/diff', :action => 'diff' |
|
156 | 154 | repository_views.connect 'projects/:id/repository/revisions/:rev/diff.:format', :action => 'diff' |
|
157 | 155 | repository_views.connect 'projects/:id/repository/revisions/:rev/raw/*path', :action => 'entry', :format => 'raw', :requirements => { :rev => /[a-z0-9\.\-_]+/ } |
|
158 | 156 | repository_views.connect 'projects/:id/repository/revisions/:rev/:action/*path', :requirements => { :rev => /[a-z0-9\.\-_]+/ } |
|
159 | 157 | repository_views.connect 'projects/:id/repository/raw/*path', :action => 'entry', :format => 'raw' |
|
160 | 158 | # TODO: why the following route is required? |
|
161 | 159 | repository_views.connect 'projects/:id/repository/entry/*path', :action => 'entry' |
|
162 | 160 | repository_views.connect 'projects/:id/repository/:action/*path' |
|
163 | 161 | end |
|
164 | 162 | |
|
165 | 163 | repositories.connect 'projects/:id/repository/:action', :conditions => {:method => :post} |
|
166 | 164 | end |
|
167 | 165 | |
|
168 | 166 | map.resources :attachments, :only => [:show, :destroy] |
|
169 | 167 | # additional routes for having the file name at the end of url |
|
170 | 168 | map.connect 'attachments/:id/:filename', :controller => 'attachments', :action => 'show', :id => /\d+/, :filename => /.*/ |
|
171 | 169 | map.connect 'attachments/download/:id/:filename', :controller => 'attachments', :action => 'download', :id => /\d+/, :filename => /.*/ |
|
172 | 170 | |
|
173 | 171 | map.resources :groups, :member => {:autocomplete_for_user => :get} |
|
174 | 172 | map.group_users 'groups/:id/users', :controller => 'groups', :action => 'add_users', :id => /\d+/, :conditions => {:method => :post} |
|
175 | 173 | map.group_user 'groups/:id/users/:user_id', :controller => 'groups', :action => 'remove_user', :id => /\d+/, :conditions => {:method => :delete} |
|
176 | 174 | |
|
177 | 175 | map.resources :trackers, :except => :show |
|
178 | 176 | map.resources :issue_statuses, :except => :show, :collection => {:update_issue_done_ratio => :post} |
|
179 | 177 | map.resources :custom_fields, :except => :show |
|
180 | 178 | map.resources :roles, :except => :show, :collection => {:permissions => [:get, :post]} |
|
181 | 179 | |
|
182 | 180 | #left old routes at the bottom for backwards compat |
|
183 | 181 | map.connect 'boards/:board_id/topics/:action/:id', :controller => 'messages' |
|
184 | 182 | map.connect 'wiki/:id/:page/:action', :page => nil, :controller => 'wiki' |
|
185 | 183 | map.connect 'projects/:project_id/news/:action', :controller => 'news' |
|
186 | 184 | map.with_options :controller => 'repositories' do |omap| |
|
187 | 185 | omap.repositories_show 'repositories/browse/:id/*path', :action => 'browse' |
|
188 | 186 | omap.repositories_changes 'repositories/changes/:id/*path', :action => 'changes' |
|
189 | 187 | omap.repositories_diff 'repositories/diff/:id/*path', :action => 'diff' |
|
190 | 188 | omap.repositories_entry 'repositories/entry/:id/*path', :action => 'entry' |
|
191 | 189 | omap.repositories_entry 'repositories/annotate/:id/*path', :action => 'annotate' |
|
192 | 190 | omap.connect 'repositories/revision/:id/:rev', :action => 'revision' |
|
193 | 191 | end |
|
194 | 192 | |
|
195 | 193 | map.with_options :controller => 'sys' do |sys| |
|
196 | 194 | sys.connect 'sys/projects.:format', :action => 'projects', :conditions => {:method => :get} |
|
197 | 195 | sys.connect 'sys/projects/:id/repository.:format', :action => 'create_project_repository', :conditions => {:method => :post} |
|
198 | 196 | end |
|
199 | 197 | |
|
200 | 198 | # Install the default route as the lowest priority. |
|
201 | 199 | map.connect ':controller/:action/:id' |
|
202 | 200 | map.connect 'robots.txt', :controller => 'welcome', :action => 'robots' |
|
203 | 201 | # Used for OpenID |
|
204 | 202 | map.root :controller => 'account', :action => 'login' |
|
205 | 203 | end |
@@ -1,445 +1,445 | |||
|
1 | 1 | # Redmine - project management software |
|
2 | 2 | # Copyright (C) 2006-2011 Jean-Philippe Lang |
|
3 | 3 | # |
|
4 | 4 | # This program is free software; you can redistribute it and/or |
|
5 | 5 | # modify it under the terms of the GNU General Public License |
|
6 | 6 | # as published by the Free Software Foundation; either version 2 |
|
7 | 7 | # of the License, or (at your option) any later version. |
|
8 | 8 | # |
|
9 | 9 | # This program is distributed in the hope that it will be useful, |
|
10 | 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
11 | 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
12 | 12 | # GNU General Public License for more details. |
|
13 | 13 | # |
|
14 | 14 | # You should have received a copy of the GNU General Public License |
|
15 | 15 | # along with this program; if not, write to the Free Software |
|
16 | 16 | # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
|
17 | 17 | |
|
18 | 18 | require File.expand_path('../../test_helper', __FILE__) |
|
19 | 19 | |
|
20 | 20 | class RoutingTest < ActionController::IntegrationTest |
|
21 | 21 | context "activities" do |
|
22 | 22 | should_route :get, "/activity", :controller => 'activities', :action => 'index', :id => nil |
|
23 | 23 | should_route :get, "/activity.atom", :controller => 'activities', :action => 'index', :id => nil, :format => 'atom' |
|
24 | 24 | end |
|
25 | 25 | |
|
26 | 26 | context "attachments" do |
|
27 | 27 | should_route :get, "/attachments/1", :controller => 'attachments', :action => 'show', :id => '1' |
|
28 | 28 | should_route :get, "/attachments/1.xml", :controller => 'attachments', :action => 'show', :id => '1', :format => 'xml' |
|
29 | 29 | should_route :get, "/attachments/1.json", :controller => 'attachments', :action => 'show', :id => '1', :format => 'json' |
|
30 | 30 | should_route :get, "/attachments/1/filename.ext", :controller => 'attachments', :action => 'show', :id => '1', :filename => 'filename.ext' |
|
31 | 31 | should_route :get, "/attachments/download/1", :controller => 'attachments', :action => 'download', :id => '1' |
|
32 | 32 | should_route :get, "/attachments/download/1/filename.ext", :controller => 'attachments', :action => 'download', :id => '1', :filename => 'filename.ext' |
|
33 | 33 | end |
|
34 | 34 | |
|
35 | 35 | context "boards" do |
|
36 | 36 | should_route :get, "/projects/world_domination/boards", :controller => 'boards', :action => 'index', :project_id => 'world_domination' |
|
37 | 37 | should_route :get, "/projects/world_domination/boards/new", :controller => 'boards', :action => 'new', :project_id => 'world_domination' |
|
38 | 38 | should_route :get, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44' |
|
39 | 39 | should_route :get, "/projects/world_domination/boards/44.atom", :controller => 'boards', :action => 'show', :project_id => 'world_domination', :id => '44', :format => 'atom' |
|
40 | 40 | should_route :get, "/projects/world_domination/boards/44/edit", :controller => 'boards', :action => 'edit', :project_id => 'world_domination', :id => '44' |
|
41 | 41 | |
|
42 | 42 | should_route :post, "/projects/world_domination/boards", :controller => 'boards', :action => 'create', :project_id => 'world_domination' |
|
43 | 43 | should_route :put, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'update', :project_id => 'world_domination', :id => '44' |
|
44 | 44 | should_route :delete, "/projects/world_domination/boards/44", :controller => 'boards', :action => 'destroy', :project_id => 'world_domination', :id => '44' |
|
45 | 45 | |
|
46 | 46 | end |
|
47 | 47 | |
|
48 | 48 | context "custom_fields" do |
|
49 | 49 | should_route :get, "/custom_fields", :controller => 'custom_fields', :action => 'index' |
|
50 | 50 | should_route :get, "/custom_fields/new", :controller => 'custom_fields', :action => 'new' |
|
51 | 51 | should_route :post, "/custom_fields", :controller => 'custom_fields', :action => 'create' |
|
52 | 52 | should_route :get, "/custom_fields/2/edit", :controller => 'custom_fields', :action => 'edit', :id => 2 |
|
53 | 53 | should_route :put, "/custom_fields/2", :controller => 'custom_fields', :action => 'update', :id => 2 |
|
54 | 54 | should_route :delete, "/custom_fields/2", :controller => 'custom_fields', :action => 'destroy', :id => 2 |
|
55 | 55 | end |
|
56 | 56 | |
|
57 | 57 | context "documents" do |
|
58 | 58 | should_route :get, "/projects/567/documents", :controller => 'documents', :action => 'index', :project_id => '567' |
|
59 | 59 | should_route :get, "/projects/567/documents/new", :controller => 'documents', :action => 'new', :project_id => '567' |
|
60 | 60 | should_route :get, "/documents/22", :controller => 'documents', :action => 'show', :id => '22' |
|
61 | 61 | should_route :get, "/documents/22/edit", :controller => 'documents', :action => 'edit', :id => '22' |
|
62 | 62 | |
|
63 | 63 | should_route :post, "/projects/567/documents", :controller => 'documents', :action => 'create', :project_id => '567' |
|
64 | 64 | should_route :put, "/documents/22", :controller => 'documents', :action => 'update', :id => '22' |
|
65 | 65 | should_route :delete, "/documents/22", :controller => 'documents', :action => 'destroy', :id => '22' |
|
66 | 66 | |
|
67 | 67 | should_route :post, "/documents/22/add_attachment", :controller => 'documents', :action => 'add_attachment', :id => '22' |
|
68 | 68 | end |
|
69 | 69 | |
|
70 | 70 | context "groups" do |
|
71 | 71 | should_route :post, "/groups/567/users", :controller => 'groups', :action => 'add_users', :id => '567' |
|
72 | 72 | should_route :delete, "/groups/567/users/12", :controller => 'groups', :action => 'remove_user', :id => '567', :user_id => '12' |
|
73 | 73 | end |
|
74 | 74 | |
|
75 | 75 | context "issues" do |
|
76 | 76 | # REST actions |
|
77 | 77 | should_route :get, "/issues", :controller => 'issues', :action => 'index' |
|
78 | 78 | should_route :get, "/issues.pdf", :controller => 'issues', :action => 'index', :format => 'pdf' |
|
79 | 79 | should_route :get, "/issues.atom", :controller => 'issues', :action => 'index', :format => 'atom' |
|
80 | 80 | should_route :get, "/issues.xml", :controller => 'issues', :action => 'index', :format => 'xml' |
|
81 | 81 | should_route :get, "/projects/23/issues", :controller => 'issues', :action => 'index', :project_id => '23' |
|
82 | 82 | should_route :get, "/projects/23/issues.pdf", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'pdf' |
|
83 | 83 | should_route :get, "/projects/23/issues.atom", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'atom' |
|
84 | 84 | should_route :get, "/projects/23/issues.xml", :controller => 'issues', :action => 'index', :project_id => '23', :format => 'xml' |
|
85 | 85 | should_route :get, "/issues/64", :controller => 'issues', :action => 'show', :id => '64' |
|
86 | 86 | should_route :get, "/issues/64.pdf", :controller => 'issues', :action => 'show', :id => '64', :format => 'pdf' |
|
87 | 87 | should_route :get, "/issues/64.atom", :controller => 'issues', :action => 'show', :id => '64', :format => 'atom' |
|
88 | 88 | should_route :get, "/issues/64.xml", :controller => 'issues', :action => 'show', :id => '64', :format => 'xml' |
|
89 | 89 | |
|
90 | 90 | should_route :get, "/projects/23/issues/new", :controller => 'issues', :action => 'new', :project_id => '23' |
|
91 | 91 | should_route :post, "/projects/23/issues", :controller => 'issues', :action => 'create', :project_id => '23' |
|
92 | 92 | should_route :post, "/issues.xml", :controller => 'issues', :action => 'create', :format => 'xml' |
|
93 | 93 | |
|
94 | 94 | should_route :get, "/issues/64/edit", :controller => 'issues', :action => 'edit', :id => '64' |
|
95 | 95 | should_route :put, "/issues/1.xml", :controller => 'issues', :action => 'update', :id => '1', :format => 'xml' |
|
96 | 96 | |
|
97 | 97 | # TODO: Should use DELETE |
|
98 | 98 | should_route :post, "/issues/64/destroy", :controller => 'issues', :action => 'destroy', :id => '64' |
|
99 | 99 | should_route :delete, "/issues/1.xml", :controller => 'issues', :action => 'destroy', :id => '1', :format => 'xml' |
|
100 | 100 | |
|
101 | 101 | # Extra actions |
|
102 | 102 | should_route :get, "/projects/23/issues/64/copy", :controller => 'issues', :action => 'new', :project_id => '23', :copy_from => '64' |
|
103 | 103 | |
|
104 | 104 | should_route :get, "/issues/move/new", :controller => 'issue_moves', :action => 'new' |
|
105 | 105 | should_route :post, "/issues/move", :controller => 'issue_moves', :action => 'create' |
|
106 | 106 | |
|
107 | 107 | should_route :post, "/issues/1/quoted", :controller => 'journals', :action => 'new', :id => '1' |
|
108 | 108 | |
|
109 | 109 | should_route :get, "/issues/calendar", :controller => 'calendars', :action => 'show' |
|
110 | 110 | should_route :get, "/projects/project-name/issues/calendar", :controller => 'calendars', :action => 'show', :project_id => 'project-name' |
|
111 | 111 | |
|
112 | 112 | should_route :get, "/issues/gantt", :controller => 'gantts', :action => 'show' |
|
113 | 113 | should_route :get, "/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :format => 'pdf' |
|
114 | 114 | should_route :get, "/projects/project-name/issues/gantt", :controller => 'gantts', :action => 'show', :project_id => 'project-name' |
|
115 | 115 | should_route :get, "/projects/project-name/issues/gantt.pdf", :controller => 'gantts', :action => 'show', :project_id => 'project-name', :format => 'pdf' |
|
116 | 116 | |
|
117 | 117 | should_route :get, "/issues/auto_complete", :controller => 'auto_completes', :action => 'issues' |
|
118 | 118 | |
|
119 | 119 | should_route :get, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123' |
|
120 | 120 | should_route :post, "/issues/preview/123", :controller => 'previews', :action => 'issue', :id => '123' |
|
121 | 121 | should_route :get, "/issues/context_menu", :controller => 'context_menus', :action => 'issues' |
|
122 | 122 | should_route :post, "/issues/context_menu", :controller => 'context_menus', :action => 'issues' |
|
123 | 123 | |
|
124 | 124 | should_route :get, "/issues/changes", :controller => 'journals', :action => 'index' |
|
125 | 125 | |
|
126 | 126 | should_route :get, "/issues/bulk_edit", :controller => 'issues', :action => 'bulk_edit' |
|
127 |
should_route :post, "/issues/bulk_ |
|
|
127 | should_route :post, "/issues/bulk_update", :controller => 'issues', :action => 'bulk_update' | |
|
128 | 128 | end |
|
129 | 129 | |
|
130 | 130 | context "issue categories" do |
|
131 | 131 | should_route :get, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'index', :project_id => 'foo' |
|
132 | 132 | should_route :get, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'xml' |
|
133 | 133 | should_route :get, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'index', :project_id => 'foo', :format => 'json' |
|
134 | 134 | |
|
135 | 135 | should_route :get, "/projects/foo/issue_categories/new", :controller => 'issue_categories', :action => 'new', :project_id => 'foo' |
|
136 | 136 | |
|
137 | 137 | should_route :post, "/projects/foo/issue_categories", :controller => 'issue_categories', :action => 'create', :project_id => 'foo' |
|
138 | 138 | should_route :post, "/projects/foo/issue_categories.xml", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'xml' |
|
139 | 139 | should_route :post, "/projects/foo/issue_categories.json", :controller => 'issue_categories', :action => 'create', :project_id => 'foo', :format => 'json' |
|
140 | 140 | |
|
141 | 141 | should_route :get, "/issue_categories/1", :controller => 'issue_categories', :action => 'show', :id => '1' |
|
142 | 142 | should_route :get, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'xml' |
|
143 | 143 | should_route :get, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'show', :id => '1', :format => 'json' |
|
144 | 144 | |
|
145 | 145 | should_route :get, "/issue_categories/1/edit", :controller => 'issue_categories', :action => 'edit', :id => '1' |
|
146 | 146 | |
|
147 | 147 | should_route :put, "/issue_categories/1", :controller => 'issue_categories', :action => 'update', :id => '1' |
|
148 | 148 | should_route :put, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'xml' |
|
149 | 149 | should_route :put, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'update', :id => '1', :format => 'json' |
|
150 | 150 | |
|
151 | 151 | should_route :delete, "/issue_categories/1", :controller => 'issue_categories', :action => 'destroy', :id => '1' |
|
152 | 152 | should_route :delete, "/issue_categories/1.xml", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'xml' |
|
153 | 153 | should_route :delete, "/issue_categories/1.json", :controller => 'issue_categories', :action => 'destroy', :id => '1', :format => 'json' |
|
154 | 154 | end |
|
155 | 155 | |
|
156 | 156 | context "issue relations" do |
|
157 | 157 | should_route :get, "/issues/1/relations", :controller => 'issue_relations', :action => 'index', :issue_id => '1' |
|
158 | 158 | should_route :get, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'xml' |
|
159 | 159 | should_route :get, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'index', :issue_id => '1', :format => 'json' |
|
160 | 160 | |
|
161 | 161 | should_route :post, "/issues/1/relations", :controller => 'issue_relations', :action => 'create', :issue_id => '1' |
|
162 | 162 | should_route :post, "/issues/1/relations.xml", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'xml' |
|
163 | 163 | should_route :post, "/issues/1/relations.json", :controller => 'issue_relations', :action => 'create', :issue_id => '1', :format => 'json' |
|
164 | 164 | |
|
165 | 165 | should_route :get, "/relations/23", :controller => 'issue_relations', :action => 'show', :id => '23' |
|
166 | 166 | should_route :get, "/relations/23.xml", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'xml' |
|
167 | 167 | should_route :get, "/relations/23.json", :controller => 'issue_relations', :action => 'show', :id => '23', :format => 'json' |
|
168 | 168 | |
|
169 | 169 | should_route :delete, "/relations/23", :controller => 'issue_relations', :action => 'destroy', :id => '23' |
|
170 | 170 | should_route :delete, "/relations/23.xml", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'xml' |
|
171 | 171 | should_route :delete, "/relations/23.json", :controller => 'issue_relations', :action => 'destroy', :id => '23', :format => 'json' |
|
172 | 172 | end |
|
173 | 173 | |
|
174 | 174 | context "issue reports" do |
|
175 | 175 | should_route :get, "/projects/567/issues/report", :controller => 'reports', :action => 'issue_report', :id => '567' |
|
176 | 176 | should_route :get, "/projects/567/issues/report/assigned_to", :controller => 'reports', :action => 'issue_report_details', :id => '567', :detail => 'assigned_to' |
|
177 | 177 | end |
|
178 | 178 | |
|
179 | 179 | context "members" do |
|
180 | 180 | should_route :post, "/projects/5234/members/new", :controller => 'members', :action => 'new', :id => '5234' |
|
181 | 181 | end |
|
182 | 182 | |
|
183 | 183 | context "messages" do |
|
184 | 184 | should_route :get, "/boards/22/topics/2", :controller => 'messages', :action => 'show', :id => '2', :board_id => '22' |
|
185 | 185 | should_route :get, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala' |
|
186 | 186 | should_route :get, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala' |
|
187 | 187 | |
|
188 | 188 | should_route :post, "/boards/lala/topics/new", :controller => 'messages', :action => 'new', :board_id => 'lala' |
|
189 | 189 | should_route :post, "/boards/lala/topics/22/edit", :controller => 'messages', :action => 'edit', :id => '22', :board_id => 'lala' |
|
190 | 190 | should_route :post, "/boards/22/topics/555/replies", :controller => 'messages', :action => 'reply', :id => '555', :board_id => '22' |
|
191 | 191 | should_route :post, "/boards/22/topics/555/destroy", :controller => 'messages', :action => 'destroy', :id => '555', :board_id => '22' |
|
192 | 192 | end |
|
193 | 193 | |
|
194 | 194 | context "news" do |
|
195 | 195 | should_route :get, "/news", :controller => 'news', :action => 'index' |
|
196 | 196 | should_route :get, "/news.atom", :controller => 'news', :action => 'index', :format => 'atom' |
|
197 | 197 | should_route :get, "/news.xml", :controller => 'news', :action => 'index', :format => 'xml' |
|
198 | 198 | should_route :get, "/news.json", :controller => 'news', :action => 'index', :format => 'json' |
|
199 | 199 | should_route :get, "/projects/567/news", :controller => 'news', :action => 'index', :project_id => '567' |
|
200 | 200 | should_route :get, "/projects/567/news.atom", :controller => 'news', :action => 'index', :format => 'atom', :project_id => '567' |
|
201 | 201 | should_route :get, "/projects/567/news.xml", :controller => 'news', :action => 'index', :format => 'xml', :project_id => '567' |
|
202 | 202 | should_route :get, "/projects/567/news.json", :controller => 'news', :action => 'index', :format => 'json', :project_id => '567' |
|
203 | 203 | should_route :get, "/news/2", :controller => 'news', :action => 'show', :id => '2' |
|
204 | 204 | should_route :get, "/projects/567/news/new", :controller => 'news', :action => 'new', :project_id => '567' |
|
205 | 205 | should_route :get, "/news/234", :controller => 'news', :action => 'show', :id => '234' |
|
206 | 206 | should_route :get, "/news/567/edit", :controller => 'news', :action => 'edit', :id => '567' |
|
207 | 207 | should_route :get, "/news/preview", :controller => 'previews', :action => 'news' |
|
208 | 208 | |
|
209 | 209 | should_route :post, "/projects/567/news", :controller => 'news', :action => 'create', :project_id => '567' |
|
210 | 210 | should_route :post, "/news/567/comments", :controller => 'comments', :action => 'create', :id => '567' |
|
211 | 211 | |
|
212 | 212 | should_route :put, "/news/567", :controller => 'news', :action => 'update', :id => '567' |
|
213 | 213 | |
|
214 | 214 | should_route :delete, "/news/567", :controller => 'news', :action => 'destroy', :id => '567' |
|
215 | 215 | should_route :delete, "/news/567/comments/15", :controller => 'comments', :action => 'destroy', :id => '567', :comment_id => '15' |
|
216 | 216 | end |
|
217 | 217 | |
|
218 | 218 | context "projects" do |
|
219 | 219 | should_route :get, "/projects", :controller => 'projects', :action => 'index' |
|
220 | 220 | should_route :get, "/projects.atom", :controller => 'projects', :action => 'index', :format => 'atom' |
|
221 | 221 | should_route :get, "/projects.xml", :controller => 'projects', :action => 'index', :format => 'xml' |
|
222 | 222 | should_route :get, "/projects/new", :controller => 'projects', :action => 'new' |
|
223 | 223 | should_route :get, "/projects/test", :controller => 'projects', :action => 'show', :id => 'test' |
|
224 | 224 | should_route :get, "/projects/1.xml", :controller => 'projects', :action => 'show', :id => '1', :format => 'xml' |
|
225 | 225 | should_route :get, "/projects/4223/settings", :controller => 'projects', :action => 'settings', :id => '4223' |
|
226 | 226 | should_route :get, "/projects/4223/settings/members", :controller => 'projects', :action => 'settings', :id => '4223', :tab => 'members' |
|
227 | 227 | should_route :get, "/projects/33/files", :controller => 'files', :action => 'index', :project_id => '33' |
|
228 | 228 | should_route :get, "/projects/33/files/new", :controller => 'files', :action => 'new', :project_id => '33' |
|
229 | 229 | should_route :get, "/projects/33/roadmap", :controller => 'versions', :action => 'index', :project_id => '33' |
|
230 | 230 | should_route :get, "/projects/33/activity", :controller => 'activities', :action => 'index', :id => '33' |
|
231 | 231 | should_route :get, "/projects/33/activity.atom", :controller => 'activities', :action => 'index', :id => '33', :format => 'atom' |
|
232 | 232 | |
|
233 | 233 | should_route :post, "/projects", :controller => 'projects', :action => 'create' |
|
234 | 234 | should_route :post, "/projects.xml", :controller => 'projects', :action => 'create', :format => 'xml' |
|
235 | 235 | should_route :post, "/projects/33/files", :controller => 'files', :action => 'create', :project_id => '33' |
|
236 | 236 | should_route :post, "/projects/64/archive", :controller => 'projects', :action => 'archive', :id => '64' |
|
237 | 237 | should_route :post, "/projects/64/unarchive", :controller => 'projects', :action => 'unarchive', :id => '64' |
|
238 | 238 | |
|
239 | 239 | should_route :put, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'update', :project_id => '64' |
|
240 | 240 | should_route :put, "/projects/4223", :controller => 'projects', :action => 'update', :id => '4223' |
|
241 | 241 | should_route :put, "/projects/1.xml", :controller => 'projects', :action => 'update', :id => '1', :format => 'xml' |
|
242 | 242 | |
|
243 | 243 | should_route :delete, "/projects/64", :controller => 'projects', :action => 'destroy', :id => '64' |
|
244 | 244 | should_route :delete, "/projects/1.xml", :controller => 'projects', :action => 'destroy', :id => '1', :format => 'xml' |
|
245 | 245 | should_route :delete, "/projects/64/enumerations", :controller => 'project_enumerations', :action => 'destroy', :project_id => '64' |
|
246 | 246 | end |
|
247 | 247 | |
|
248 | 248 | context "queries" do |
|
249 | 249 | should_route :get, "/queries.xml", :controller => 'queries', :action => 'index', :format => 'xml' |
|
250 | 250 | should_route :get, "/queries.json", :controller => 'queries', :action => 'index', :format => 'json' |
|
251 | 251 | |
|
252 | 252 | should_route :get, "/queries/new", :controller => 'queries', :action => 'new' |
|
253 | 253 | should_route :get, "/projects/redmine/queries/new", :controller => 'queries', :action => 'new', :project_id => 'redmine' |
|
254 | 254 | |
|
255 | 255 | should_route :post, "/queries", :controller => 'queries', :action => 'create' |
|
256 | 256 | should_route :post, "/projects/redmine/queries", :controller => 'queries', :action => 'create', :project_id => 'redmine' |
|
257 | 257 | |
|
258 | 258 | should_route :get, "/queries/1/edit", :controller => 'queries', :action => 'edit', :id => '1' |
|
259 | 259 | |
|
260 | 260 | should_route :put, "/queries/1", :controller => 'queries', :action => 'update', :id => '1' |
|
261 | 261 | |
|
262 | 262 | should_route :delete, "/queries/1", :controller => 'queries', :action => 'destroy', :id => '1' |
|
263 | 263 | end |
|
264 | 264 | |
|
265 | 265 | context "repositories" do |
|
266 | 266 | should_route :get, "/projects/redmine/repository", :controller => 'repositories', :action => 'show', :id => 'redmine' |
|
267 | 267 | should_route :get, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine' |
|
268 | 268 | should_route :get, "/projects/redmine/repository/revisions", :controller => 'repositories', :action => 'revisions', :id => 'redmine' |
|
269 | 269 | should_route :get, "/projects/redmine/repository/revisions.atom", :controller => 'repositories', :action => 'revisions', :id => 'redmine', :format => 'atom' |
|
270 | 270 | should_route :get, "/projects/redmine/repository/revisions/2457", :controller => 'repositories', :action => 'revision', :id => 'redmine', :rev => '2457' |
|
271 | 271 | should_route :get, "/projects/redmine/repository/revisions/2457/diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457' |
|
272 | 272 | should_route :get, "/projects/redmine/repository/revisions/2457/diff.diff", :controller => 'repositories', :action => 'diff', :id => 'redmine', :rev => '2457', :format => 'diff' |
|
273 | 273 | should_route :get, "/projects/redmine/repository/diff/path/to/file.c", :controller => 'repositories', :action => 'diff', :id => 'redmine', :path => %w[path to file.c] |
|
274 | 274 | 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' |
|
275 | 275 | should_route :get, "/projects/redmine/repository/browse/path/to/file.c", :controller => 'repositories', :action => 'browse', :id => 'redmine', :path => %w[path to file.c] |
|
276 | 276 | should_route :get, "/projects/redmine/repository/entry/path/to/file.c", :controller => 'repositories', :action => 'entry', :id => 'redmine', :path => %w[path to file.c] |
|
277 | 277 | 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' |
|
278 | 278 | 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' |
|
279 | 279 | 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' |
|
280 | 280 | should_route :get, "/projects/redmine/repository/annotate/path/to/file.c", :controller => 'repositories', :action => 'annotate', :id => 'redmine', :path => %w[path to file.c] |
|
281 | 281 | should_route :get, "/projects/redmine/repository/changes/path/to/file.c", :controller => 'repositories', :action => 'changes', :id => 'redmine', :path => %w[path to file.c] |
|
282 | 282 | should_route :get, "/projects/redmine/repository/statistics", :controller => 'repositories', :action => 'stats', :id => 'redmine' |
|
283 | 283 | |
|
284 | 284 | should_route :post, "/projects/redmine/repository/edit", :controller => 'repositories', :action => 'edit', :id => 'redmine' |
|
285 | 285 | end |
|
286 | 286 | |
|
287 | 287 | context "roles" do |
|
288 | 288 | should_route :get, "/roles", :controller => 'roles', :action => 'index' |
|
289 | 289 | should_route :get, "/roles/new", :controller => 'roles', :action => 'new' |
|
290 | 290 | should_route :post, "/roles", :controller => 'roles', :action => 'create' |
|
291 | 291 | should_route :get, "/roles/2/edit", :controller => 'roles', :action => 'edit', :id => 2 |
|
292 | 292 | should_route :put, "/roles/2", :controller => 'roles', :action => 'update', :id => 2 |
|
293 | 293 | should_route :delete, "/roles/2", :controller => 'roles', :action => 'destroy', :id => 2 |
|
294 | 294 | should_route :get, "/roles/permissions", :controller => 'roles', :action => 'permissions' |
|
295 | 295 | should_route :post, "/roles/permissions", :controller => 'roles', :action => 'permissions' |
|
296 | 296 | end |
|
297 | 297 | |
|
298 | 298 | context "timelogs (global)" do |
|
299 | 299 | should_route :get, "/time_entries", :controller => 'timelog', :action => 'index' |
|
300 | 300 | should_route :get, "/time_entries.csv", :controller => 'timelog', :action => 'index', :format => 'csv' |
|
301 | 301 | should_route :get, "/time_entries.atom", :controller => 'timelog', :action => 'index', :format => 'atom' |
|
302 | 302 | should_route :get, "/time_entries/new", :controller => 'timelog', :action => 'new' |
|
303 | 303 | should_route :get, "/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22' |
|
304 | 304 | |
|
305 | 305 | should_route :post, "/time_entries", :controller => 'timelog', :action => 'create' |
|
306 | 306 | |
|
307 | 307 | should_route :put, "/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22' |
|
308 | 308 | |
|
309 | 309 | should_route :delete, "/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55' |
|
310 | 310 | end |
|
311 | 311 | |
|
312 | 312 | context "timelogs (scoped under project)" do |
|
313 | 313 | should_route :get, "/projects/567/time_entries", :controller => 'timelog', :action => 'index', :project_id => '567' |
|
314 | 314 | should_route :get, "/projects/567/time_entries.csv", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'csv' |
|
315 | 315 | should_route :get, "/projects/567/time_entries.atom", :controller => 'timelog', :action => 'index', :project_id => '567', :format => 'atom' |
|
316 | 316 | should_route :get, "/projects/567/time_entries/new", :controller => 'timelog', :action => 'new', :project_id => '567' |
|
317 | 317 | should_route :get, "/projects/567/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :project_id => '567' |
|
318 | 318 | |
|
319 | 319 | should_route :post, "/projects/567/time_entries", :controller => 'timelog', :action => 'create', :project_id => '567' |
|
320 | 320 | |
|
321 | 321 | should_route :put, "/projects/567/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :project_id => '567' |
|
322 | 322 | |
|
323 | 323 | should_route :delete, "/projects/567/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :project_id => '567' |
|
324 | 324 | end |
|
325 | 325 | |
|
326 | 326 | context "timelogs (scoped under issues)" do |
|
327 | 327 | should_route :get, "/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234' |
|
328 | 328 | should_route :get, "/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'csv' |
|
329 | 329 | should_route :get, "/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :format => 'atom' |
|
330 | 330 | should_route :get, "/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234' |
|
331 | 331 | should_route :get, "/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234' |
|
332 | 332 | |
|
333 | 333 | should_route :post, "/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234' |
|
334 | 334 | |
|
335 | 335 | should_route :put, "/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234' |
|
336 | 336 | |
|
337 | 337 | should_route :delete, "/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234' |
|
338 | 338 | end |
|
339 | 339 | |
|
340 | 340 | context "timelogs (scoped under project and issues)" do |
|
341 | 341 | should_route :get, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook' |
|
342 | 342 | should_route :get, "/projects/ecookbook/issues/234/time_entries.csv", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'csv' |
|
343 | 343 | should_route :get, "/projects/ecookbook/issues/234/time_entries.atom", :controller => 'timelog', :action => 'index', :issue_id => '234', :project_id => 'ecookbook', :format => 'atom' |
|
344 | 344 | should_route :get, "/projects/ecookbook/issues/234/time_entries/new", :controller => 'timelog', :action => 'new', :issue_id => '234', :project_id => 'ecookbook' |
|
345 | 345 | should_route :get, "/projects/ecookbook/issues/234/time_entries/22/edit", :controller => 'timelog', :action => 'edit', :id => '22', :issue_id => '234', :project_id => 'ecookbook' |
|
346 | 346 | |
|
347 | 347 | should_route :post, "/projects/ecookbook/issues/234/time_entries", :controller => 'timelog', :action => 'create', :issue_id => '234', :project_id => 'ecookbook' |
|
348 | 348 | |
|
349 | 349 | should_route :put, "/projects/ecookbook/issues/234/time_entries/22", :controller => 'timelog', :action => 'update', :id => '22', :issue_id => '234', :project_id => 'ecookbook' |
|
350 | 350 | |
|
351 | 351 | should_route :delete, "/projects/ecookbook/issues/234/time_entries/55", :controller => 'timelog', :action => 'destroy', :id => '55', :issue_id => '234', :project_id => 'ecookbook' |
|
352 | 352 | |
|
353 | 353 | should_route :get, "/time_entries/report", :controller => 'timelog', :action => 'report' |
|
354 | 354 | should_route :get, "/projects/567/time_entries/report", :controller => 'timelog', :action => 'report', :project_id => '567' |
|
355 | 355 | should_route :get, "/projects/567/time_entries/report.csv", :controller => 'timelog', :action => 'report', :project_id => '567', :format => 'csv' |
|
356 | 356 | end |
|
357 | 357 | |
|
358 | 358 | context "users" do |
|
359 | 359 | should_route :get, "/users", :controller => 'users', :action => 'index' |
|
360 | 360 | should_route :get, "/users.xml", :controller => 'users', :action => 'index', :format => 'xml' |
|
361 | 361 | should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44' |
|
362 | 362 | should_route :get, "/users/44.xml", :controller => 'users', :action => 'show', :id => '44', :format => 'xml' |
|
363 | 363 | should_route :get, "/users/current", :controller => 'users', :action => 'show', :id => 'current' |
|
364 | 364 | should_route :get, "/users/current.xml", :controller => 'users', :action => 'show', :id => 'current', :format => 'xml' |
|
365 | 365 | should_route :get, "/users/new", :controller => 'users', :action => 'new' |
|
366 | 366 | should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444' |
|
367 | 367 | |
|
368 | 368 | should_route :post, "/users", :controller => 'users', :action => 'create' |
|
369 | 369 | should_route :post, "/users.xml", :controller => 'users', :action => 'create', :format => 'xml' |
|
370 | 370 | |
|
371 | 371 | should_route :put, "/users/444", :controller => 'users', :action => 'update', :id => '444' |
|
372 | 372 | should_route :put, "/users/444.xml", :controller => 'users', :action => 'update', :id => '444', :format => 'xml' |
|
373 | 373 | |
|
374 | 374 | should_route :delete, "/users/44", :controller => 'users', :action => 'destroy', :id => '44' |
|
375 | 375 | should_route :delete, "/users/44.xml", :controller => 'users', :action => 'destroy', :id => '44', :format => 'xml' |
|
376 | 376 | |
|
377 | 377 | should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123' |
|
378 | 378 | should_route :put, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55' |
|
379 | 379 | should_route :delete, "/users/123/memberships/55", :controller => 'users', :action => 'destroy_membership', :id => '123', :membership_id => '55' |
|
380 | 380 | end |
|
381 | 381 | |
|
382 | 382 | context "versions" do |
|
383 | 383 | # /projects/foo/versions is /projects/foo/roadmap |
|
384 | 384 | should_route :get, "/projects/foo/versions.xml", :controller => 'versions', :action => 'index', :project_id => 'foo', :format => 'xml' |
|
385 | 385 | should_route :get, "/projects/foo/versions.json", :controller => 'versions', :action => 'index', :project_id => 'foo', :format => 'json' |
|
386 | 386 | |
|
387 | 387 | should_route :get, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo' |
|
388 | 388 | |
|
389 | 389 | should_route :post, "/projects/foo/versions", :controller => 'versions', :action => 'create', :project_id => 'foo' |
|
390 | 390 | should_route :post, "/projects/foo/versions.xml", :controller => 'versions', :action => 'create', :project_id => 'foo', :format => 'xml' |
|
391 | 391 | should_route :post, "/projects/foo/versions.json", :controller => 'versions', :action => 'create', :project_id => 'foo', :format => 'json' |
|
392 | 392 | |
|
393 | 393 | should_route :get, "/versions/1", :controller => 'versions', :action => 'show', :id => '1' |
|
394 | 394 | should_route :get, "/versions/1.xml", :controller => 'versions', :action => 'show', :id => '1', :format => 'xml' |
|
395 | 395 | should_route :get, "/versions/1.json", :controller => 'versions', :action => 'show', :id => '1', :format => 'json' |
|
396 | 396 | |
|
397 | 397 | should_route :get, "/versions/1/edit", :controller => 'versions', :action => 'edit', :id => '1' |
|
398 | 398 | |
|
399 | 399 | should_route :put, "/versions/1", :controller => 'versions', :action => 'update', :id => '1' |
|
400 | 400 | should_route :put, "/versions/1.xml", :controller => 'versions', :action => 'update', :id => '1', :format => 'xml' |
|
401 | 401 | should_route :put, "/versions/1.json", :controller => 'versions', :action => 'update', :id => '1', :format => 'json' |
|
402 | 402 | |
|
403 | 403 | should_route :delete, "/versions/1", :controller => 'versions', :action => 'destroy', :id => '1' |
|
404 | 404 | should_route :delete, "/versions/1.xml", :controller => 'versions', :action => 'destroy', :id => '1', :format => 'xml' |
|
405 | 405 | should_route :delete, "/versions/1.json", :controller => 'versions', :action => 'destroy', :id => '1', :format => 'json' |
|
406 | 406 | |
|
407 | 407 | should_route :put, "/projects/foo/versions/close_completed", :controller => 'versions', :action => 'close_completed', :project_id => 'foo' |
|
408 | 408 | should_route :post, "/versions/1/status_by", :controller => 'versions', :action => 'status_by', :id => '1' |
|
409 | 409 | end |
|
410 | 410 | |
|
411 | 411 | context "wiki (singular, project's pages)" do |
|
412 | 412 | should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'show', :project_id => '567' |
|
413 | 413 | should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'show', :project_id => '567', :id => 'lalala' |
|
414 | 414 | should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :project_id => '567', :id => 'my_page' |
|
415 | 415 | should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :project_id => '1', :id => 'CookBook_documentation' |
|
416 | 416 | should_route :get, "/projects/1/wiki/CookBook_documentation/diff", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation' |
|
417 | 417 | should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2", :controller => 'wiki', :action => 'diff', :project_id => '1', :id => 'CookBook_documentation', :version => '2' |
|
418 | 418 | 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' |
|
419 | 419 | should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :project_id => '1', :id => 'CookBook_documentation', :version => '2' |
|
420 | 420 | should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida' |
|
421 | 421 | should_route :get, "/projects/567/wiki/index", :controller => 'wiki', :action => 'index', :project_id => '567' |
|
422 | 422 | should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'date_index', :project_id => '567' |
|
423 | 423 | should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'export', :project_id => '567' |
|
424 | 424 | |
|
425 | 425 | should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :project_id => '567', :id => 'CookBook_documentation' |
|
426 | 426 | should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :project_id => '22', :id => 'ladida' |
|
427 | 427 | should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :project_id => '22', :id => 'ladida' |
|
428 | 428 | should_route :post, "/projects/22/wiki/ladida/add_attachment", :controller => 'wiki', :action => 'add_attachment', :project_id => '22', :id => 'ladida' |
|
429 | 429 | |
|
430 | 430 | should_route :put, "/projects/567/wiki/my_page", :controller => 'wiki', :action => 'update', :project_id => '567', :id => 'my_page' |
|
431 | 431 | |
|
432 | 432 | should_route :delete, "/projects/22/wiki/ladida", :controller => 'wiki', :action => 'destroy', :project_id => '22', :id => 'ladida' |
|
433 | 433 | end |
|
434 | 434 | |
|
435 | 435 | context "wikis (plural, admin setup)" do |
|
436 | 436 | should_route :get, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida' |
|
437 | 437 | |
|
438 | 438 | should_route :post, "/projects/ladida/wiki", :controller => 'wikis', :action => 'edit', :id => 'ladida' |
|
439 | 439 | should_route :post, "/projects/ladida/wiki/destroy", :controller => 'wikis', :action => 'destroy', :id => 'ladida' |
|
440 | 440 | end |
|
441 | 441 | |
|
442 | 442 | context "administration panel" do |
|
443 | 443 | should_route :get, "/admin/projects", :controller => 'admin', :action => 'projects' |
|
444 | 444 | end |
|
445 | 445 | end |
General Comments 0
You need to be logged in to leave comments.
Login now