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