@@ -1,31 +1,40 | |||||
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 RoutingActivitiesTest < ActionController::IntegrationTest |
|
20 | class RoutingActivitiesTest < ActionController::IntegrationTest | |
21 | def test_activities |
|
21 | def test_activities | |
22 | assert_routing( |
|
22 | assert_routing( | |
23 | { :method => 'get', :path => "/activity" }, |
|
23 | { :method => 'get', :path => "/activity" }, | |
24 | { :controller => 'activities', :action => 'index', :id => nil } |
|
24 | { :controller => 'activities', :action => 'index', :id => nil } | |
25 | ) |
|
25 | ) | |
26 | assert_routing( |
|
26 | assert_routing( | |
27 | { :method => 'get', :path => "/activity.atom" }, |
|
27 | { :method => 'get', :path => "/activity.atom" }, | |
28 | { :controller => 'activities', :action => 'index', :id => nil, :format => 'atom' } |
|
28 | { :controller => 'activities', :action => 'index', :id => nil, :format => 'atom' } | |
29 | ) |
|
29 | ) | |
|
30 | assert_routing( | |||
|
31 | { :method => 'get', :path => "/projects/33/activity" }, | |||
|
32 | { :controller => 'activities', :action => 'index', :id => '33' } | |||
|
33 | ) | |||
|
34 | assert_routing( | |||
|
35 | { :method => 'get', :path => "/projects/33/activity.atom" }, | |||
|
36 | { :controller => 'activities', :action => 'index', :id => '33', | |||
|
37 | :format => 'atom' } | |||
|
38 | ) | |||
30 | end |
|
39 | end | |
31 | end |
|
40 | end |
@@ -1,666 +1,657 | |||||
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 | def test_issues_rest_actions |
|
21 | def test_issues_rest_actions | |
22 | assert_routing( |
|
22 | assert_routing( | |
23 | { :method => 'get', :path => "/issues" }, |
|
23 | { :method => 'get', :path => "/issues" }, | |
24 | { :controller => 'issues', :action => 'index' } |
|
24 | { :controller => 'issues', :action => 'index' } | |
25 | ) |
|
25 | ) | |
26 | assert_routing( |
|
26 | assert_routing( | |
27 | { :method => 'get', :path => "/issues.pdf" }, |
|
27 | { :method => 'get', :path => "/issues.pdf" }, | |
28 | { :controller => 'issues', :action => 'index', :format => 'pdf' } |
|
28 | { :controller => 'issues', :action => 'index', :format => 'pdf' } | |
29 | ) |
|
29 | ) | |
30 | assert_routing( |
|
30 | assert_routing( | |
31 | { :method => 'get', :path => "/issues.atom" }, |
|
31 | { :method => 'get', :path => "/issues.atom" }, | |
32 | { :controller => 'issues', :action => 'index', :format => 'atom' } |
|
32 | { :controller => 'issues', :action => 'index', :format => 'atom' } | |
33 | ) |
|
33 | ) | |
34 | assert_routing( |
|
34 | assert_routing( | |
35 | { :method => 'get', :path => "/issues.xml" }, |
|
35 | { :method => 'get', :path => "/issues.xml" }, | |
36 | { :controller => 'issues', :action => 'index', :format => 'xml' } |
|
36 | { :controller => 'issues', :action => 'index', :format => 'xml' } | |
37 | ) |
|
37 | ) | |
38 | assert_routing( |
|
38 | assert_routing( | |
39 | { :method => 'get', :path => "/projects/23/issues" }, |
|
39 | { :method => 'get', :path => "/projects/23/issues" }, | |
40 | { :controller => 'issues', :action => 'index', :project_id => '23' } |
|
40 | { :controller => 'issues', :action => 'index', :project_id => '23' } | |
41 | ) |
|
41 | ) | |
42 | assert_routing( |
|
42 | assert_routing( | |
43 | { :method => 'get', :path => "/projects/23/issues.pdf" }, |
|
43 | { :method => 'get', :path => "/projects/23/issues.pdf" }, | |
44 | { :controller => 'issues', :action => 'index', :project_id => '23', |
|
44 | { :controller => 'issues', :action => 'index', :project_id => '23', | |
45 | :format => 'pdf' } |
|
45 | :format => 'pdf' } | |
46 | ) |
|
46 | ) | |
47 | assert_routing( |
|
47 | assert_routing( | |
48 | { :method => 'get', :path => "/projects/23/issues.atom" }, |
|
48 | { :method => 'get', :path => "/projects/23/issues.atom" }, | |
49 | { :controller => 'issues', :action => 'index', :project_id => '23', |
|
49 | { :controller => 'issues', :action => 'index', :project_id => '23', | |
50 | :format => 'atom' } |
|
50 | :format => 'atom' } | |
51 | ) |
|
51 | ) | |
52 | assert_routing( |
|
52 | assert_routing( | |
53 | { :method => 'get', :path => "/projects/23/issues.xml" }, |
|
53 | { :method => 'get', :path => "/projects/23/issues.xml" }, | |
54 | { :controller => 'issues', :action => 'index', :project_id => '23', |
|
54 | { :controller => 'issues', :action => 'index', :project_id => '23', | |
55 | :format => 'xml' } |
|
55 | :format => 'xml' } | |
56 | ) |
|
56 | ) | |
57 | assert_routing( |
|
57 | assert_routing( | |
58 | { :method => 'get', :path => "/issues/64" }, |
|
58 | { :method => 'get', :path => "/issues/64" }, | |
59 | { :controller => 'issues', :action => 'show', :id => '64' } |
|
59 | { :controller => 'issues', :action => 'show', :id => '64' } | |
60 | ) |
|
60 | ) | |
61 | assert_routing( |
|
61 | assert_routing( | |
62 | { :method => 'get', :path => "/issues/64.pdf" }, |
|
62 | { :method => 'get', :path => "/issues/64.pdf" }, | |
63 | { :controller => 'issues', :action => 'show', :id => '64', |
|
63 | { :controller => 'issues', :action => 'show', :id => '64', | |
64 | :format => 'pdf' } |
|
64 | :format => 'pdf' } | |
65 | ) |
|
65 | ) | |
66 | assert_routing( |
|
66 | assert_routing( | |
67 | { :method => 'get', :path => "/issues/64.atom" }, |
|
67 | { :method => 'get', :path => "/issues/64.atom" }, | |
68 | { :controller => 'issues', :action => 'show', :id => '64', |
|
68 | { :controller => 'issues', :action => 'show', :id => '64', | |
69 | :format => 'atom' } |
|
69 | :format => 'atom' } | |
70 | ) |
|
70 | ) | |
71 | assert_routing( |
|
71 | assert_routing( | |
72 | { :method => 'get', :path => "/issues/64.xml" }, |
|
72 | { :method => 'get', :path => "/issues/64.xml" }, | |
73 | { :controller => 'issues', :action => 'show', :id => '64', |
|
73 | { :controller => 'issues', :action => 'show', :id => '64', | |
74 | :format => 'xml' } |
|
74 | :format => 'xml' } | |
75 | ) |
|
75 | ) | |
76 | assert_routing( |
|
76 | assert_routing( | |
77 | { :method => 'get', :path => "/projects/23/issues/new" }, |
|
77 | { :method => 'get', :path => "/projects/23/issues/new" }, | |
78 | { :controller => 'issues', :action => 'new', :project_id => '23' } |
|
78 | { :controller => 'issues', :action => 'new', :project_id => '23' } | |
79 | ) |
|
79 | ) | |
80 | end |
|
80 | end | |
81 |
|
81 | |||
82 | def test_issues_form_update |
|
82 | def test_issues_form_update | |
83 | assert_routing( |
|
83 | assert_routing( | |
84 | { :method => 'post', :path => "/projects/23/issues/new" }, |
|
84 | { :method => 'post', :path => "/projects/23/issues/new" }, | |
85 | { :controller => 'issues', :action => 'new', :project_id => '23' } |
|
85 | { :controller => 'issues', :action => 'new', :project_id => '23' } | |
86 | ) |
|
86 | ) | |
87 | assert_routing( |
|
87 | assert_routing( | |
88 | { :method => 'post', :path => "/projects/23/issues" }, |
|
88 | { :method => 'post', :path => "/projects/23/issues" }, | |
89 | { :controller => 'issues', :action => 'create', :project_id => '23' } |
|
89 | { :controller => 'issues', :action => 'create', :project_id => '23' } | |
90 | ) |
|
90 | ) | |
91 | assert_routing( |
|
91 | assert_routing( | |
92 | { :method => 'post', :path => "/issues.xml" }, |
|
92 | { :method => 'post', :path => "/issues.xml" }, | |
93 | { :controller => 'issues', :action => 'create', :format => 'xml' } |
|
93 | { :controller => 'issues', :action => 'create', :format => 'xml' } | |
94 | ) |
|
94 | ) | |
95 | assert_routing( |
|
95 | assert_routing( | |
96 | { :method => 'get', :path => "/issues/64/edit" }, |
|
96 | { :method => 'get', :path => "/issues/64/edit" }, | |
97 | { :controller => 'issues', :action => 'edit', :id => '64' } |
|
97 | { :controller => 'issues', :action => 'edit', :id => '64' } | |
98 | ) |
|
98 | ) | |
99 | assert_routing( |
|
99 | assert_routing( | |
100 | { :method => 'put', :path => "/issues/1.xml" }, |
|
100 | { :method => 'put', :path => "/issues/1.xml" }, | |
101 | { :controller => 'issues', :action => 'update', :id => '1', |
|
101 | { :controller => 'issues', :action => 'update', :id => '1', | |
102 | :format => 'xml' } |
|
102 | :format => 'xml' } | |
103 | ) |
|
103 | ) | |
104 | assert_routing( |
|
104 | assert_routing( | |
105 | { :method => 'delete', :path => "/issues/1.xml" }, |
|
105 | { :method => 'delete', :path => "/issues/1.xml" }, | |
106 | { :controller => 'issues', :action => 'destroy', :id => '1', |
|
106 | { :controller => 'issues', :action => 'destroy', :id => '1', | |
107 | :format => 'xml' } |
|
107 | :format => 'xml' } | |
108 | ) |
|
108 | ) | |
109 | end |
|
109 | end | |
110 |
|
110 | |||
111 | def test_issues_extra_actions |
|
111 | def test_issues_extra_actions | |
112 | assert_routing( |
|
112 | assert_routing( | |
113 | { :method => 'get', :path => "/projects/23/issues/64/copy" }, |
|
113 | { :method => 'get', :path => "/projects/23/issues/64/copy" }, | |
114 | { :controller => 'issues', :action => 'new', :project_id => '23', |
|
114 | { :controller => 'issues', :action => 'new', :project_id => '23', | |
115 | :copy_from => '64' } |
|
115 | :copy_from => '64' } | |
116 | ) |
|
116 | ) | |
117 | assert_routing( |
|
117 | assert_routing( | |
118 | { :method => 'get', :path => "/issues/auto_complete" }, |
|
118 | { :method => 'get', :path => "/issues/auto_complete" }, | |
119 | { :controller => 'auto_completes', :action => 'issues' } |
|
119 | { :controller => 'auto_completes', :action => 'issues' } | |
120 | ) |
|
120 | ) | |
121 | assert_routing( |
|
121 | assert_routing( | |
122 | { :method => 'get', :path => "/issues/preview/123" }, |
|
122 | { :method => 'get', :path => "/issues/preview/123" }, | |
123 | { :controller => 'previews', :action => 'issue', :id => '123' } |
|
123 | { :controller => 'previews', :action => 'issue', :id => '123' } | |
124 | ) |
|
124 | ) | |
125 | assert_routing( |
|
125 | assert_routing( | |
126 | { :method => 'post', :path => "/issues/preview/123" }, |
|
126 | { :method => 'post', :path => "/issues/preview/123" }, | |
127 | { :controller => 'previews', :action => 'issue', :id => '123' } |
|
127 | { :controller => 'previews', :action => 'issue', :id => '123' } | |
128 | ) |
|
128 | ) | |
129 | assert_routing( |
|
129 | assert_routing( | |
130 | { :method => 'get', :path => "/issues/context_menu" }, |
|
130 | { :method => 'get', :path => "/issues/context_menu" }, | |
131 | { :controller => 'context_menus', :action => 'issues' } |
|
131 | { :controller => 'context_menus', :action => 'issues' } | |
132 | ) |
|
132 | ) | |
133 | assert_routing( |
|
133 | assert_routing( | |
134 | { :method => 'post', :path => "/issues/context_menu" }, |
|
134 | { :method => 'post', :path => "/issues/context_menu" }, | |
135 | { :controller => 'context_menus', :action => 'issues' } |
|
135 | { :controller => 'context_menus', :action => 'issues' } | |
136 | ) |
|
136 | ) | |
137 | assert_routing( |
|
137 | assert_routing( | |
138 | { :method => 'get', :path => "/issues/bulk_edit" }, |
|
138 | { :method => 'get', :path => "/issues/bulk_edit" }, | |
139 | { :controller => 'issues', :action => 'bulk_edit' } |
|
139 | { :controller => 'issues', :action => 'bulk_edit' } | |
140 | ) |
|
140 | ) | |
141 | assert_routing( |
|
141 | assert_routing( | |
142 | { :method => 'post', :path => "/issues/bulk_update" }, |
|
142 | { :method => 'post', :path => "/issues/bulk_update" }, | |
143 | { :controller => 'issues', :action => 'bulk_update' } |
|
143 | { :controller => 'issues', :action => 'bulk_update' } | |
144 | ) |
|
144 | ) | |
145 | end |
|
145 | end | |
146 |
|
146 | |||
147 | def test_issue_categories |
|
147 | def test_issue_categories | |
148 | assert_routing( |
|
148 | assert_routing( | |
149 | { :method => 'get', :path => "/projects/foo/issue_categories" }, |
|
149 | { :method => 'get', :path => "/projects/foo/issue_categories" }, | |
150 | { :controller => 'issue_categories', :action => 'index', |
|
150 | { :controller => 'issue_categories', :action => 'index', | |
151 | :project_id => 'foo' } |
|
151 | :project_id => 'foo' } | |
152 | ) |
|
152 | ) | |
153 | assert_routing( |
|
153 | assert_routing( | |
154 | { :method => 'get', :path => "/projects/foo/issue_categories.xml" }, |
|
154 | { :method => 'get', :path => "/projects/foo/issue_categories.xml" }, | |
155 | { :controller => 'issue_categories', :action => 'index', |
|
155 | { :controller => 'issue_categories', :action => 'index', | |
156 | :project_id => 'foo', :format => 'xml' } |
|
156 | :project_id => 'foo', :format => 'xml' } | |
157 | ) |
|
157 | ) | |
158 | assert_routing( |
|
158 | assert_routing( | |
159 | { :method => 'get', :path => "/projects/foo/issue_categories.json" }, |
|
159 | { :method => 'get', :path => "/projects/foo/issue_categories.json" }, | |
160 | { :controller => 'issue_categories', :action => 'index', |
|
160 | { :controller => 'issue_categories', :action => 'index', | |
161 | :project_id => 'foo', :format => 'json' } |
|
161 | :project_id => 'foo', :format => 'json' } | |
162 | ) |
|
162 | ) | |
163 | assert_routing( |
|
163 | assert_routing( | |
164 | { :method => 'get', :path => "/projects/foo/issue_categories/new" }, |
|
164 | { :method => 'get', :path => "/projects/foo/issue_categories/new" }, | |
165 | { :controller => 'issue_categories', :action => 'new', |
|
165 | { :controller => 'issue_categories', :action => 'new', | |
166 | :project_id => 'foo' } |
|
166 | :project_id => 'foo' } | |
167 | ) |
|
167 | ) | |
168 | assert_routing( |
|
168 | assert_routing( | |
169 | { :method => 'post', :path => "/projects/foo/issue_categories" }, |
|
169 | { :method => 'post', :path => "/projects/foo/issue_categories" }, | |
170 | { :controller => 'issue_categories', :action => 'create', |
|
170 | { :controller => 'issue_categories', :action => 'create', | |
171 | :project_id => 'foo' } |
|
171 | :project_id => 'foo' } | |
172 | ) |
|
172 | ) | |
173 | assert_routing( |
|
173 | assert_routing( | |
174 | { :method => 'post', :path => "/projects/foo/issue_categories.xml" }, |
|
174 | { :method => 'post', :path => "/projects/foo/issue_categories.xml" }, | |
175 | { :controller => 'issue_categories', :action => 'create', |
|
175 | { :controller => 'issue_categories', :action => 'create', | |
176 | :project_id => 'foo', :format => 'xml' } |
|
176 | :project_id => 'foo', :format => 'xml' } | |
177 | ) |
|
177 | ) | |
178 | assert_routing( |
|
178 | assert_routing( | |
179 | { :method => 'post', :path => "/projects/foo/issue_categories.json" }, |
|
179 | { :method => 'post', :path => "/projects/foo/issue_categories.json" }, | |
180 | { :controller => 'issue_categories', :action => 'create', |
|
180 | { :controller => 'issue_categories', :action => 'create', | |
181 | :project_id => 'foo', :format => 'json' } |
|
181 | :project_id => 'foo', :format => 'json' } | |
182 | ) |
|
182 | ) | |
183 | assert_routing( |
|
183 | assert_routing( | |
184 | { :method => 'get', :path => "/issue_categories/1" }, |
|
184 | { :method => 'get', :path => "/issue_categories/1" }, | |
185 | { :controller => 'issue_categories', :action => 'show', :id => '1' } |
|
185 | { :controller => 'issue_categories', :action => 'show', :id => '1' } | |
186 | ) |
|
186 | ) | |
187 | assert_routing( |
|
187 | assert_routing( | |
188 | { :method => 'get', :path => "/issue_categories/1.xml" }, |
|
188 | { :method => 'get', :path => "/issue_categories/1.xml" }, | |
189 | { :controller => 'issue_categories', :action => 'show', :id => '1', |
|
189 | { :controller => 'issue_categories', :action => 'show', :id => '1', | |
190 | :format => 'xml' } |
|
190 | :format => 'xml' } | |
191 | ) |
|
191 | ) | |
192 | assert_routing( |
|
192 | assert_routing( | |
193 | { :method => 'get', :path => "/issue_categories/1.json" }, |
|
193 | { :method => 'get', :path => "/issue_categories/1.json" }, | |
194 | { :controller => 'issue_categories', :action => 'show', :id => '1', |
|
194 | { :controller => 'issue_categories', :action => 'show', :id => '1', | |
195 | :format => 'json' } |
|
195 | :format => 'json' } | |
196 | ) |
|
196 | ) | |
197 | assert_routing( |
|
197 | assert_routing( | |
198 | { :method => 'get', :path => "/issue_categories/1/edit" }, |
|
198 | { :method => 'get', :path => "/issue_categories/1/edit" }, | |
199 | { :controller => 'issue_categories', :action => 'edit', :id => '1' } |
|
199 | { :controller => 'issue_categories', :action => 'edit', :id => '1' } | |
200 | ) |
|
200 | ) | |
201 | assert_routing( |
|
201 | assert_routing( | |
202 | { :method => 'put', :path => "/issue_categories/1" }, |
|
202 | { :method => 'put', :path => "/issue_categories/1" }, | |
203 | { :controller => 'issue_categories', :action => 'update', :id => '1' } |
|
203 | { :controller => 'issue_categories', :action => 'update', :id => '1' } | |
204 | ) |
|
204 | ) | |
205 | assert_routing( |
|
205 | assert_routing( | |
206 | { :method => 'put', :path => "/issue_categories/1.xml" }, |
|
206 | { :method => 'put', :path => "/issue_categories/1.xml" }, | |
207 | { :controller => 'issue_categories', :action => 'update', :id => '1', |
|
207 | { :controller => 'issue_categories', :action => 'update', :id => '1', | |
208 | :format => 'xml' } |
|
208 | :format => 'xml' } | |
209 | ) |
|
209 | ) | |
210 | assert_routing( |
|
210 | assert_routing( | |
211 | { :method => 'put', :path => "/issue_categories/1.json" }, |
|
211 | { :method => 'put', :path => "/issue_categories/1.json" }, | |
212 | { :controller => 'issue_categories', :action => 'update', :id => '1', |
|
212 | { :controller => 'issue_categories', :action => 'update', :id => '1', | |
213 | :format => 'json' } |
|
213 | :format => 'json' } | |
214 | ) |
|
214 | ) | |
215 | assert_routing( |
|
215 | assert_routing( | |
216 | { :method => 'delete', :path => "/issue_categories/1" }, |
|
216 | { :method => 'delete', :path => "/issue_categories/1" }, | |
217 | { :controller => 'issue_categories', :action => 'destroy', :id => '1' } |
|
217 | { :controller => 'issue_categories', :action => 'destroy', :id => '1' } | |
218 | ) |
|
218 | ) | |
219 | assert_routing( |
|
219 | assert_routing( | |
220 | { :method => 'delete', :path => "/issue_categories/1.xml" }, |
|
220 | { :method => 'delete', :path => "/issue_categories/1.xml" }, | |
221 | { :controller => 'issue_categories', :action => 'destroy', :id => '1', |
|
221 | { :controller => 'issue_categories', :action => 'destroy', :id => '1', | |
222 | :format => 'xml' } |
|
222 | :format => 'xml' } | |
223 | ) |
|
223 | ) | |
224 | assert_routing( |
|
224 | assert_routing( | |
225 | { :method => 'delete', :path => "/issue_categories/1.json" }, |
|
225 | { :method => 'delete', :path => "/issue_categories/1.json" }, | |
226 | { :controller => 'issue_categories', :action => 'destroy', :id => '1', |
|
226 | { :controller => 'issue_categories', :action => 'destroy', :id => '1', | |
227 | :format => 'json' } |
|
227 | :format => 'json' } | |
228 | ) |
|
228 | ) | |
229 | end |
|
229 | end | |
230 |
|
230 | |||
231 | def test_news |
|
231 | def test_news | |
232 | assert_routing( |
|
232 | assert_routing( | |
233 | { :method => 'get', :path => "/news" }, |
|
233 | { :method => 'get', :path => "/news" }, | |
234 | { :controller => 'news', :action => 'index' } |
|
234 | { :controller => 'news', :action => 'index' } | |
235 | ) |
|
235 | ) | |
236 | assert_routing( |
|
236 | assert_routing( | |
237 | { :method => 'get', :path => "/news.atom" }, |
|
237 | { :method => 'get', :path => "/news.atom" }, | |
238 | { :controller => 'news', :action => 'index', :format => 'atom' } |
|
238 | { :controller => 'news', :action => 'index', :format => 'atom' } | |
239 | ) |
|
239 | ) | |
240 | assert_routing( |
|
240 | assert_routing( | |
241 | { :method => 'get', :path => "/news.xml" }, |
|
241 | { :method => 'get', :path => "/news.xml" }, | |
242 | { :controller => 'news', :action => 'index', :format => 'xml' } |
|
242 | { :controller => 'news', :action => 'index', :format => 'xml' } | |
243 | ) |
|
243 | ) | |
244 | assert_routing( |
|
244 | assert_routing( | |
245 | { :method => 'get', :path => "/news.json" }, |
|
245 | { :method => 'get', :path => "/news.json" }, | |
246 | { :controller => 'news', :action => 'index', :format => 'json' } |
|
246 | { :controller => 'news', :action => 'index', :format => 'json' } | |
247 | ) |
|
247 | ) | |
248 | assert_routing( |
|
248 | assert_routing( | |
249 | { :method => 'get', :path => "/projects/567/news" }, |
|
249 | { :method => 'get', :path => "/projects/567/news" }, | |
250 | { :controller => 'news', :action => 'index', :project_id => '567' } |
|
250 | { :controller => 'news', :action => 'index', :project_id => '567' } | |
251 | ) |
|
251 | ) | |
252 | assert_routing( |
|
252 | assert_routing( | |
253 | { :method => 'get', :path => "/projects/567/news.atom" }, |
|
253 | { :method => 'get', :path => "/projects/567/news.atom" }, | |
254 | { :controller => 'news', :action => 'index', :format => 'atom', |
|
254 | { :controller => 'news', :action => 'index', :format => 'atom', | |
255 | :project_id => '567' } |
|
255 | :project_id => '567' } | |
256 | ) |
|
256 | ) | |
257 | assert_routing( |
|
257 | assert_routing( | |
258 | { :method => 'get', :path => "/projects/567/news.xml" }, |
|
258 | { :method => 'get', :path => "/projects/567/news.xml" }, | |
259 | { :controller => 'news', :action => 'index', :format => 'xml', |
|
259 | { :controller => 'news', :action => 'index', :format => 'xml', | |
260 | :project_id => '567' } |
|
260 | :project_id => '567' } | |
261 | ) |
|
261 | ) | |
262 | assert_routing( |
|
262 | assert_routing( | |
263 | { :method => 'get', :path => "/projects/567/news.json" }, |
|
263 | { :method => 'get', :path => "/projects/567/news.json" }, | |
264 | { :controller => 'news', :action => 'index', :format => 'json', |
|
264 | { :controller => 'news', :action => 'index', :format => 'json', | |
265 | :project_id => '567' } |
|
265 | :project_id => '567' } | |
266 | ) |
|
266 | ) | |
267 | assert_routing( |
|
267 | assert_routing( | |
268 | { :method => 'get', :path => "/news/2" }, |
|
268 | { :method => 'get', :path => "/news/2" }, | |
269 | { :controller => 'news', :action => 'show', :id => '2' } |
|
269 | { :controller => 'news', :action => 'show', :id => '2' } | |
270 | ) |
|
270 | ) | |
271 | assert_routing( |
|
271 | assert_routing( | |
272 | { :method => 'get', :path => "/projects/567/news/new" }, |
|
272 | { :method => 'get', :path => "/projects/567/news/new" }, | |
273 | { :controller => 'news', :action => 'new', :project_id => '567' } |
|
273 | { :controller => 'news', :action => 'new', :project_id => '567' } | |
274 | ) |
|
274 | ) | |
275 | assert_routing( |
|
275 | assert_routing( | |
276 | { :method => 'get', :path => "/news/234" }, |
|
276 | { :method => 'get', :path => "/news/234" }, | |
277 | { :controller => 'news', :action => 'show', :id => '234' } |
|
277 | { :controller => 'news', :action => 'show', :id => '234' } | |
278 | ) |
|
278 | ) | |
279 | assert_routing( |
|
279 | assert_routing( | |
280 | { :method => 'get', :path => "/news/567/edit" }, |
|
280 | { :method => 'get', :path => "/news/567/edit" }, | |
281 | { :controller => 'news', :action => 'edit', :id => '567' } |
|
281 | { :controller => 'news', :action => 'edit', :id => '567' } | |
282 | ) |
|
282 | ) | |
283 | assert_routing( |
|
283 | assert_routing( | |
284 | { :method => 'get', :path => "/news/preview" }, |
|
284 | { :method => 'get', :path => "/news/preview" }, | |
285 | { :controller => 'previews', :action => 'news' } |
|
285 | { :controller => 'previews', :action => 'news' } | |
286 | ) |
|
286 | ) | |
287 | assert_routing( |
|
287 | assert_routing( | |
288 | { :method => 'post', :path => "/projects/567/news" }, |
|
288 | { :method => 'post', :path => "/projects/567/news" }, | |
289 | { :controller => 'news', :action => 'create', :project_id => '567' } |
|
289 | { :controller => 'news', :action => 'create', :project_id => '567' } | |
290 | ) |
|
290 | ) | |
291 | assert_routing( |
|
291 | assert_routing( | |
292 | { :method => 'post', :path => "/news/567/comments" }, |
|
292 | { :method => 'post', :path => "/news/567/comments" }, | |
293 | { :controller => 'comments', :action => 'create', :id => '567' } |
|
293 | { :controller => 'comments', :action => 'create', :id => '567' } | |
294 | ) |
|
294 | ) | |
295 | assert_routing( |
|
295 | assert_routing( | |
296 | { :method => 'put', :path => "/news/567" }, |
|
296 | { :method => 'put', :path => "/news/567" }, | |
297 | { :controller => 'news', :action => 'update', :id => '567' } |
|
297 | { :controller => 'news', :action => 'update', :id => '567' } | |
298 | ) |
|
298 | ) | |
299 | assert_routing( |
|
299 | assert_routing( | |
300 | { :method => 'delete', :path => "/news/567" }, |
|
300 | { :method => 'delete', :path => "/news/567" }, | |
301 | { :controller => 'news', :action => 'destroy', :id => '567' } |
|
301 | { :controller => 'news', :action => 'destroy', :id => '567' } | |
302 | ) |
|
302 | ) | |
303 | assert_routing( |
|
303 | assert_routing( | |
304 | { :method => 'delete', :path => "/news/567/comments/15" }, |
|
304 | { :method => 'delete', :path => "/news/567/comments/15" }, | |
305 | { :controller => 'comments', :action => 'destroy', :id => '567', |
|
305 | { :controller => 'comments', :action => 'destroy', :id => '567', | |
306 | :comment_id => '15' } |
|
306 | :comment_id => '15' } | |
307 | ) |
|
307 | ) | |
308 | end |
|
308 | end | |
309 |
|
309 | |||
310 | def test_projects |
|
310 | def test_projects | |
311 | assert_routing( |
|
311 | assert_routing( | |
312 | { :method => 'get', :path => "/projects" }, |
|
312 | { :method => 'get', :path => "/projects" }, | |
313 | { :controller => 'projects', :action => 'index' } |
|
313 | { :controller => 'projects', :action => 'index' } | |
314 | ) |
|
314 | ) | |
315 | assert_routing( |
|
315 | assert_routing( | |
316 | { :method => 'get', :path => "/projects.atom" }, |
|
316 | { :method => 'get', :path => "/projects.atom" }, | |
317 | { :controller => 'projects', :action => 'index', :format => 'atom' } |
|
317 | { :controller => 'projects', :action => 'index', :format => 'atom' } | |
318 | ) |
|
318 | ) | |
319 | assert_routing( |
|
319 | assert_routing( | |
320 | { :method => 'get', :path => "/projects.xml" }, |
|
320 | { :method => 'get', :path => "/projects.xml" }, | |
321 | { :controller => 'projects', :action => 'index', :format => 'xml' } |
|
321 | { :controller => 'projects', :action => 'index', :format => 'xml' } | |
322 | ) |
|
322 | ) | |
323 | assert_routing( |
|
323 | assert_routing( | |
324 | { :method => 'get', :path => "/projects/new" }, |
|
324 | { :method => 'get', :path => "/projects/new" }, | |
325 | { :controller => 'projects', :action => 'new' } |
|
325 | { :controller => 'projects', :action => 'new' } | |
326 | ) |
|
326 | ) | |
327 | assert_routing( |
|
327 | assert_routing( | |
328 | { :method => 'get', :path => "/projects/test" }, |
|
328 | { :method => 'get', :path => "/projects/test" }, | |
329 | { :controller => 'projects', :action => 'show', :id => 'test' } |
|
329 | { :controller => 'projects', :action => 'show', :id => 'test' } | |
330 | ) |
|
330 | ) | |
331 | assert_routing( |
|
331 | assert_routing( | |
332 | { :method => 'get', :path => "/projects/1.xml" }, |
|
332 | { :method => 'get', :path => "/projects/1.xml" }, | |
333 | { :controller => 'projects', :action => 'show', :id => '1', |
|
333 | { :controller => 'projects', :action => 'show', :id => '1', | |
334 | :format => 'xml' } |
|
334 | :format => 'xml' } | |
335 | ) |
|
335 | ) | |
336 | assert_routing( |
|
336 | assert_routing( | |
337 | { :method => 'get', :path => "/projects/4223/settings" }, |
|
337 | { :method => 'get', :path => "/projects/4223/settings" }, | |
338 | { :controller => 'projects', :action => 'settings', :id => '4223' } |
|
338 | { :controller => 'projects', :action => 'settings', :id => '4223' } | |
339 | ) |
|
339 | ) | |
340 | assert_routing( |
|
340 | assert_routing( | |
341 | { :method => 'get', :path => "/projects/4223/settings/members" }, |
|
341 | { :method => 'get', :path => "/projects/4223/settings/members" }, | |
342 | { :controller => 'projects', :action => 'settings', :id => '4223', |
|
342 | { :controller => 'projects', :action => 'settings', :id => '4223', | |
343 | :tab => 'members' } |
|
343 | :tab => 'members' } | |
344 | ) |
|
344 | ) | |
345 | assert_routing( |
|
345 | assert_routing( | |
346 | { :method => 'get', :path => "/projects/33/roadmap" }, |
|
346 | { :method => 'get', :path => "/projects/33/roadmap" }, | |
347 | { :controller => 'versions', :action => 'index', :project_id => '33' } |
|
347 | { :controller => 'versions', :action => 'index', :project_id => '33' } | |
348 | ) |
|
348 | ) | |
349 | assert_routing( |
|
349 | assert_routing( | |
350 | { :method => 'get', :path => "/projects/33/activity" }, |
|
|||
351 | { :controller => 'activities', :action => 'index', :id => '33' } |
|
|||
352 | ) |
|
|||
353 | assert_routing( |
|
|||
354 | { :method => 'get', :path => "/projects/33/activity.atom" }, |
|
|||
355 | { :controller => 'activities', :action => 'index', :id => '33', |
|
|||
356 | :format => 'atom' } |
|
|||
357 | ) |
|
|||
358 | assert_routing( |
|
|||
359 | { :method => 'post', :path => "/projects" }, |
|
350 | { :method => 'post', :path => "/projects" }, | |
360 | { :controller => 'projects', :action => 'create' } |
|
351 | { :controller => 'projects', :action => 'create' } | |
361 | ) |
|
352 | ) | |
362 | assert_routing( |
|
353 | assert_routing( | |
363 | { :method => 'post', :path => "/projects.xml" }, |
|
354 | { :method => 'post', :path => "/projects.xml" }, | |
364 | { :controller => 'projects', :action => 'create', :format => 'xml' } |
|
355 | { :controller => 'projects', :action => 'create', :format => 'xml' } | |
365 | ) |
|
356 | ) | |
366 | assert_routing( |
|
357 | assert_routing( | |
367 | { :method => 'post', :path => "/projects/64/archive" }, |
|
358 | { :method => 'post', :path => "/projects/64/archive" }, | |
368 | { :controller => 'projects', :action => 'archive', :id => '64' } |
|
359 | { :controller => 'projects', :action => 'archive', :id => '64' } | |
369 | ) |
|
360 | ) | |
370 | assert_routing( |
|
361 | assert_routing( | |
371 | { :method => 'post', :path => "/projects/64/unarchive" }, |
|
362 | { :method => 'post', :path => "/projects/64/unarchive" }, | |
372 | { :controller => 'projects', :action => 'unarchive', :id => '64' } |
|
363 | { :controller => 'projects', :action => 'unarchive', :id => '64' } | |
373 | ) |
|
364 | ) | |
374 | assert_routing( |
|
365 | assert_routing( | |
375 | { :method => 'put', :path => "/projects/64/enumerations" }, |
|
366 | { :method => 'put', :path => "/projects/64/enumerations" }, | |
376 | { :controller => 'project_enumerations', :action => 'update', |
|
367 | { :controller => 'project_enumerations', :action => 'update', | |
377 | :project_id => '64' } |
|
368 | :project_id => '64' } | |
378 | ) |
|
369 | ) | |
379 | assert_routing( |
|
370 | assert_routing( | |
380 | { :method => 'put', :path => "/projects/4223" }, |
|
371 | { :method => 'put', :path => "/projects/4223" }, | |
381 | { :controller => 'projects', :action => 'update', :id => '4223' } |
|
372 | { :controller => 'projects', :action => 'update', :id => '4223' } | |
382 | ) |
|
373 | ) | |
383 | assert_routing( |
|
374 | assert_routing( | |
384 | { :method => 'put', :path => "/projects/1.xml" }, |
|
375 | { :method => 'put', :path => "/projects/1.xml" }, | |
385 | { :controller => 'projects', :action => 'update', :id => '1', |
|
376 | { :controller => 'projects', :action => 'update', :id => '1', | |
386 | :format => 'xml' } |
|
377 | :format => 'xml' } | |
387 | ) |
|
378 | ) | |
388 | assert_routing( |
|
379 | assert_routing( | |
389 | { :method => 'delete', :path => "/projects/64" }, |
|
380 | { :method => 'delete', :path => "/projects/64" }, | |
390 | { :controller => 'projects', :action => 'destroy', :id => '64' } |
|
381 | { :controller => 'projects', :action => 'destroy', :id => '64' } | |
391 | ) |
|
382 | ) | |
392 | assert_routing( |
|
383 | assert_routing( | |
393 | { :method => 'delete', :path => "/projects/1.xml" }, |
|
384 | { :method => 'delete', :path => "/projects/1.xml" }, | |
394 | { :controller => 'projects', :action => 'destroy', :id => '1', |
|
385 | { :controller => 'projects', :action => 'destroy', :id => '1', | |
395 | :format => 'xml' } |
|
386 | :format => 'xml' } | |
396 | ) |
|
387 | ) | |
397 | assert_routing( |
|
388 | assert_routing( | |
398 | { :method => 'delete', :path => "/projects/64/enumerations" }, |
|
389 | { :method => 'delete', :path => "/projects/64/enumerations" }, | |
399 | { :controller => 'project_enumerations', :action => 'destroy', |
|
390 | { :controller => 'project_enumerations', :action => 'destroy', | |
400 | :project_id => '64' } |
|
391 | :project_id => '64' } | |
401 | ) |
|
392 | ) | |
402 | end |
|
393 | end | |
403 |
|
394 | |||
404 | def test_queries |
|
395 | def test_queries | |
405 | assert_routing( |
|
396 | assert_routing( | |
406 | { :method => 'get', :path => "/queries.xml" }, |
|
397 | { :method => 'get', :path => "/queries.xml" }, | |
407 | { :controller => 'queries', :action => 'index', :format => 'xml' } |
|
398 | { :controller => 'queries', :action => 'index', :format => 'xml' } | |
408 | ) |
|
399 | ) | |
409 | assert_routing( |
|
400 | assert_routing( | |
410 | { :method => 'get', :path => "/queries.json" }, |
|
401 | { :method => 'get', :path => "/queries.json" }, | |
411 | { :controller => 'queries', :action => 'index', :format => 'json' } |
|
402 | { :controller => 'queries', :action => 'index', :format => 'json' } | |
412 | ) |
|
403 | ) | |
413 | assert_routing( |
|
404 | assert_routing( | |
414 | { :method => 'get', :path => "/queries/new" }, |
|
405 | { :method => 'get', :path => "/queries/new" }, | |
415 | { :controller => 'queries', :action => 'new' } |
|
406 | { :controller => 'queries', :action => 'new' } | |
416 | ) |
|
407 | ) | |
417 | assert_routing( |
|
408 | assert_routing( | |
418 | { :method => 'get', :path => "/projects/redmine/queries/new" }, |
|
409 | { :method => 'get', :path => "/projects/redmine/queries/new" }, | |
419 | { :controller => 'queries', :action => 'new', :project_id => 'redmine' } |
|
410 | { :controller => 'queries', :action => 'new', :project_id => 'redmine' } | |
420 | ) |
|
411 | ) | |
421 | assert_routing( |
|
412 | assert_routing( | |
422 | { :method => 'post', :path => "/queries" }, |
|
413 | { :method => 'post', :path => "/queries" }, | |
423 | { :controller => 'queries', :action => 'create' } |
|
414 | { :controller => 'queries', :action => 'create' } | |
424 | ) |
|
415 | ) | |
425 | assert_routing( |
|
416 | assert_routing( | |
426 | { :method => 'post', :path => "/projects/redmine/queries" }, |
|
417 | { :method => 'post', :path => "/projects/redmine/queries" }, | |
427 | { :controller => 'queries', :action => 'create', :project_id => 'redmine' } |
|
418 | { :controller => 'queries', :action => 'create', :project_id => 'redmine' } | |
428 | ) |
|
419 | ) | |
429 | assert_routing( |
|
420 | assert_routing( | |
430 | { :method => 'get', :path => "/queries/1/edit" }, |
|
421 | { :method => 'get', :path => "/queries/1/edit" }, | |
431 | { :controller => 'queries', :action => 'edit', :id => '1' } |
|
422 | { :controller => 'queries', :action => 'edit', :id => '1' } | |
432 | ) |
|
423 | ) | |
433 | assert_routing( |
|
424 | assert_routing( | |
434 | { :method => 'put', :path => "/queries/1" }, |
|
425 | { :method => 'put', :path => "/queries/1" }, | |
435 | { :controller => 'queries', :action => 'update', :id => '1' } |
|
426 | { :controller => 'queries', :action => 'update', :id => '1' } | |
436 | ) |
|
427 | ) | |
437 | assert_routing( |
|
428 | assert_routing( | |
438 | { :method => 'delete', :path => "/queries/1" }, |
|
429 | { :method => 'delete', :path => "/queries/1" }, | |
439 | { :controller => 'queries', :action => 'destroy', :id => '1' } |
|
430 | { :controller => 'queries', :action => 'destroy', :id => '1' } | |
440 | ) |
|
431 | ) | |
441 | end |
|
432 | end | |
442 |
|
433 | |||
443 | def test_roles |
|
434 | def test_roles | |
444 | assert_routing( |
|
435 | assert_routing( | |
445 | { :method => 'get', :path => "/roles" }, |
|
436 | { :method => 'get', :path => "/roles" }, | |
446 | { :controller => 'roles', :action => 'index' } |
|
437 | { :controller => 'roles', :action => 'index' } | |
447 | ) |
|
438 | ) | |
448 | assert_routing( |
|
439 | assert_routing( | |
449 | { :method => 'get', :path => "/roles/new" }, |
|
440 | { :method => 'get', :path => "/roles/new" }, | |
450 | { :controller => 'roles', :action => 'new' } |
|
441 | { :controller => 'roles', :action => 'new' } | |
451 | ) |
|
442 | ) | |
452 | assert_routing( |
|
443 | assert_routing( | |
453 | { :method => 'post', :path => "/roles" }, |
|
444 | { :method => 'post', :path => "/roles" }, | |
454 | { :controller => 'roles', :action => 'create' } |
|
445 | { :controller => 'roles', :action => 'create' } | |
455 | ) |
|
446 | ) | |
456 | assert_routing( |
|
447 | assert_routing( | |
457 | { :method => 'get', :path => "/roles/2/edit" }, |
|
448 | { :method => 'get', :path => "/roles/2/edit" }, | |
458 | { :controller => 'roles', :action => 'edit', :id => '2' } |
|
449 | { :controller => 'roles', :action => 'edit', :id => '2' } | |
459 | ) |
|
450 | ) | |
460 | assert_routing( |
|
451 | assert_routing( | |
461 | { :method => 'put', :path => "/roles/2" }, |
|
452 | { :method => 'put', :path => "/roles/2" }, | |
462 | { :controller => 'roles', :action => 'update', :id => '2' } |
|
453 | { :controller => 'roles', :action => 'update', :id => '2' } | |
463 | ) |
|
454 | ) | |
464 | assert_routing( |
|
455 | assert_routing( | |
465 | { :method => 'delete', :path => "/roles/2" }, |
|
456 | { :method => 'delete', :path => "/roles/2" }, | |
466 | { :controller => 'roles', :action => 'destroy', :id => '2' } |
|
457 | { :controller => 'roles', :action => 'destroy', :id => '2' } | |
467 | ) |
|
458 | ) | |
468 | assert_routing( |
|
459 | assert_routing( | |
469 | { :method => 'get', :path => "/roles/permissions" }, |
|
460 | { :method => 'get', :path => "/roles/permissions" }, | |
470 | { :controller => 'roles', :action => 'permissions' } |
|
461 | { :controller => 'roles', :action => 'permissions' } | |
471 | ) |
|
462 | ) | |
472 | assert_routing( |
|
463 | assert_routing( | |
473 | { :method => 'post', :path => "/roles/permissions" }, |
|
464 | { :method => 'post', :path => "/roles/permissions" }, | |
474 | { :controller => 'roles', :action => 'permissions' } |
|
465 | { :controller => 'roles', :action => 'permissions' } | |
475 | ) |
|
466 | ) | |
476 | end |
|
467 | end | |
477 |
|
468 | |||
478 | def test_users |
|
469 | def test_users | |
479 | assert_routing( |
|
470 | assert_routing( | |
480 | { :method => 'get', :path => "/users" }, |
|
471 | { :method => 'get', :path => "/users" }, | |
481 | { :controller => 'users', :action => 'index' } |
|
472 | { :controller => 'users', :action => 'index' } | |
482 | ) |
|
473 | ) | |
483 | assert_routing( |
|
474 | assert_routing( | |
484 | { :method => 'get', :path => "/users.xml" }, |
|
475 | { :method => 'get', :path => "/users.xml" }, | |
485 | { :controller => 'users', :action => 'index', :format => 'xml' } |
|
476 | { :controller => 'users', :action => 'index', :format => 'xml' } | |
486 | ) |
|
477 | ) | |
487 | assert_routing( |
|
478 | assert_routing( | |
488 | { :method => 'get', :path => "/users/44" }, |
|
479 | { :method => 'get', :path => "/users/44" }, | |
489 | { :controller => 'users', :action => 'show', :id => '44' } |
|
480 | { :controller => 'users', :action => 'show', :id => '44' } | |
490 | ) |
|
481 | ) | |
491 | assert_routing( |
|
482 | assert_routing( | |
492 | { :method => 'get', :path => "/users/44.xml" }, |
|
483 | { :method => 'get', :path => "/users/44.xml" }, | |
493 | { :controller => 'users', :action => 'show', :id => '44', |
|
484 | { :controller => 'users', :action => 'show', :id => '44', | |
494 | :format => 'xml' } |
|
485 | :format => 'xml' } | |
495 | ) |
|
486 | ) | |
496 | assert_routing( |
|
487 | assert_routing( | |
497 | { :method => 'get', :path => "/users/current" }, |
|
488 | { :method => 'get', :path => "/users/current" }, | |
498 | { :controller => 'users', :action => 'show', :id => 'current' } |
|
489 | { :controller => 'users', :action => 'show', :id => 'current' } | |
499 | ) |
|
490 | ) | |
500 | assert_routing( |
|
491 | assert_routing( | |
501 | { :method => 'get', :path => "/users/current.xml" }, |
|
492 | { :method => 'get', :path => "/users/current.xml" }, | |
502 | { :controller => 'users', :action => 'show', :id => 'current', |
|
493 | { :controller => 'users', :action => 'show', :id => 'current', | |
503 | :format => 'xml' } |
|
494 | :format => 'xml' } | |
504 | ) |
|
495 | ) | |
505 | assert_routing( |
|
496 | assert_routing( | |
506 | { :method => 'get', :path => "/users/new" }, |
|
497 | { :method => 'get', :path => "/users/new" }, | |
507 | { :controller => 'users', :action => 'new' } |
|
498 | { :controller => 'users', :action => 'new' } | |
508 | ) |
|
499 | ) | |
509 | assert_routing( |
|
500 | assert_routing( | |
510 | { :method => 'get', :path => "/users/444/edit" }, |
|
501 | { :method => 'get', :path => "/users/444/edit" }, | |
511 | { :controller => 'users', :action => 'edit', :id => '444' } |
|
502 | { :controller => 'users', :action => 'edit', :id => '444' } | |
512 | ) |
|
503 | ) | |
513 | assert_routing( |
|
504 | assert_routing( | |
514 | { :method => 'post', :path => "/users" }, |
|
505 | { :method => 'post', :path => "/users" }, | |
515 | { :controller => 'users', :action => 'create' } |
|
506 | { :controller => 'users', :action => 'create' } | |
516 | ) |
|
507 | ) | |
517 | assert_routing( |
|
508 | assert_routing( | |
518 | { :method => 'post', :path => "/users.xml" }, |
|
509 | { :method => 'post', :path => "/users.xml" }, | |
519 | { :controller => 'users', :action => 'create', :format => 'xml' } |
|
510 | { :controller => 'users', :action => 'create', :format => 'xml' } | |
520 | ) |
|
511 | ) | |
521 | assert_routing( |
|
512 | assert_routing( | |
522 | { :method => 'put', :path => "/users/444" }, |
|
513 | { :method => 'put', :path => "/users/444" }, | |
523 | { :controller => 'users', :action => 'update', :id => '444' } |
|
514 | { :controller => 'users', :action => 'update', :id => '444' } | |
524 | ) |
|
515 | ) | |
525 | assert_routing( |
|
516 | assert_routing( | |
526 | { :method => 'put', :path => "/users/444.xml" }, |
|
517 | { :method => 'put', :path => "/users/444.xml" }, | |
527 | { :controller => 'users', :action => 'update', :id => '444', |
|
518 | { :controller => 'users', :action => 'update', :id => '444', | |
528 | :format => 'xml' } |
|
519 | :format => 'xml' } | |
529 | ) |
|
520 | ) | |
530 | assert_routing( |
|
521 | assert_routing( | |
531 | { :method => 'delete', :path => "/users/44" }, |
|
522 | { :method => 'delete', :path => "/users/44" }, | |
532 | { :controller => 'users', :action => 'destroy', :id => '44' } |
|
523 | { :controller => 'users', :action => 'destroy', :id => '44' } | |
533 | ) |
|
524 | ) | |
534 | assert_routing( |
|
525 | assert_routing( | |
535 | { :method => 'delete', :path => "/users/44.xml" }, |
|
526 | { :method => 'delete', :path => "/users/44.xml" }, | |
536 | { :controller => 'users', :action => 'destroy', :id => '44', |
|
527 | { :controller => 'users', :action => 'destroy', :id => '44', | |
537 | :format => 'xml' } |
|
528 | :format => 'xml' } | |
538 | ) |
|
529 | ) | |
539 | assert_routing( |
|
530 | assert_routing( | |
540 | { :method => 'post', :path => "/users/123/memberships" }, |
|
531 | { :method => 'post', :path => "/users/123/memberships" }, | |
541 | { :controller => 'users', :action => 'edit_membership', |
|
532 | { :controller => 'users', :action => 'edit_membership', | |
542 | :id => '123' } |
|
533 | :id => '123' } | |
543 | ) |
|
534 | ) | |
544 | assert_routing( |
|
535 | assert_routing( | |
545 | { :method => 'put', :path => "/users/123/memberships/55" }, |
|
536 | { :method => 'put', :path => "/users/123/memberships/55" }, | |
546 | { :controller => 'users', :action => 'edit_membership', |
|
537 | { :controller => 'users', :action => 'edit_membership', | |
547 | :id => '123', :membership_id => '55' } |
|
538 | :id => '123', :membership_id => '55' } | |
548 | ) |
|
539 | ) | |
549 | assert_routing( |
|
540 | assert_routing( | |
550 | { :method => 'delete', :path => "/users/123/memberships/55" }, |
|
541 | { :method => 'delete', :path => "/users/123/memberships/55" }, | |
551 | { :controller => 'users', :action => 'destroy_membership', |
|
542 | { :controller => 'users', :action => 'destroy_membership', | |
552 | :id => '123', :membership_id => '55' } |
|
543 | :id => '123', :membership_id => '55' } | |
553 | ) |
|
544 | ) | |
554 | end |
|
545 | end | |
555 |
|
546 | |||
556 | def test_welcome |
|
547 | def test_welcome | |
557 | assert_routing( |
|
548 | assert_routing( | |
558 | { :method => 'get', :path => "/robots.txt" }, |
|
549 | { :method => 'get', :path => "/robots.txt" }, | |
559 | { :controller => 'welcome', :action => 'robots' } |
|
550 | { :controller => 'welcome', :action => 'robots' } | |
560 | ) |
|
551 | ) | |
561 | end |
|
552 | end | |
562 |
|
553 | |||
563 | def test_wiki_singular_projects_pages |
|
554 | def test_wiki_singular_projects_pages | |
564 | assert_routing( |
|
555 | assert_routing( | |
565 | { :method => 'get', :path => "/projects/567/wiki" }, |
|
556 | { :method => 'get', :path => "/projects/567/wiki" }, | |
566 | { :controller => 'wiki', :action => 'show', :project_id => '567' } |
|
557 | { :controller => 'wiki', :action => 'show', :project_id => '567' } | |
567 | ) |
|
558 | ) | |
568 | assert_routing( |
|
559 | assert_routing( | |
569 | { :method => 'get', :path => "/projects/567/wiki/lalala" }, |
|
560 | { :method => 'get', :path => "/projects/567/wiki/lalala" }, | |
570 | { :controller => 'wiki', :action => 'show', :project_id => '567', |
|
561 | { :controller => 'wiki', :action => 'show', :project_id => '567', | |
571 | :id => 'lalala' } |
|
562 | :id => 'lalala' } | |
572 | ) |
|
563 | ) | |
573 | assert_routing( |
|
564 | assert_routing( | |
574 | { :method => 'get', :path => "/projects/567/wiki/my_page/edit" }, |
|
565 | { :method => 'get', :path => "/projects/567/wiki/my_page/edit" }, | |
575 | { :controller => 'wiki', :action => 'edit', :project_id => '567', |
|
566 | { :controller => 'wiki', :action => 'edit', :project_id => '567', | |
576 | :id => 'my_page' } |
|
567 | :id => 'my_page' } | |
577 | ) |
|
568 | ) | |
578 | assert_routing( |
|
569 | assert_routing( | |
579 | { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/history" }, |
|
570 | { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/history" }, | |
580 | { :controller => 'wiki', :action => 'history', :project_id => '1', |
|
571 | { :controller => 'wiki', :action => 'history', :project_id => '1', | |
581 | :id => 'CookBook_documentation' } |
|
572 | :id => 'CookBook_documentation' } | |
582 | ) |
|
573 | ) | |
583 | assert_routing( |
|
574 | assert_routing( | |
584 | { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff" }, |
|
575 | { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff" }, | |
585 | { :controller => 'wiki', :action => 'diff', :project_id => '1', |
|
576 | { :controller => 'wiki', :action => 'diff', :project_id => '1', | |
586 | :id => 'CookBook_documentation' } |
|
577 | :id => 'CookBook_documentation' } | |
587 | ) |
|
578 | ) | |
588 | assert_routing( |
|
579 | assert_routing( | |
589 | { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2" }, |
|
580 | { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2" }, | |
590 | { :controller => 'wiki', :action => 'diff', :project_id => '1', |
|
581 | { :controller => 'wiki', :action => 'diff', :project_id => '1', | |
591 | :id => 'CookBook_documentation', :version => '2' } |
|
582 | :id => 'CookBook_documentation', :version => '2' } | |
592 | ) |
|
583 | ) | |
593 | assert_routing( |
|
584 | assert_routing( | |
594 | { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2/vs/1" }, |
|
585 | { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/diff/2/vs/1" }, | |
595 | { :controller => 'wiki', :action => 'diff', :project_id => '1', |
|
586 | { :controller => 'wiki', :action => 'diff', :project_id => '1', | |
596 | :id => 'CookBook_documentation', :version => '2', :version_from => '1' } |
|
587 | :id => 'CookBook_documentation', :version => '2', :version_from => '1' } | |
597 | ) |
|
588 | ) | |
598 | assert_routing( |
|
589 | assert_routing( | |
599 | { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/annotate/2" }, |
|
590 | { :method => 'get', :path => "/projects/1/wiki/CookBook_documentation/annotate/2" }, | |
600 | { :controller => 'wiki', :action => 'annotate', :project_id => '1', |
|
591 | { :controller => 'wiki', :action => 'annotate', :project_id => '1', | |
601 | :id => 'CookBook_documentation', :version => '2' } |
|
592 | :id => 'CookBook_documentation', :version => '2' } | |
602 | ) |
|
593 | ) | |
603 | assert_routing( |
|
594 | assert_routing( | |
604 | { :method => 'get', :path => "/projects/22/wiki/ladida/rename" }, |
|
595 | { :method => 'get', :path => "/projects/22/wiki/ladida/rename" }, | |
605 | { :controller => 'wiki', :action => 'rename', :project_id => '22', |
|
596 | { :controller => 'wiki', :action => 'rename', :project_id => '22', | |
606 | :id => 'ladida' } |
|
597 | :id => 'ladida' } | |
607 | ) |
|
598 | ) | |
608 | assert_routing( |
|
599 | assert_routing( | |
609 | { :method => 'get', :path => "/projects/567/wiki/index" }, |
|
600 | { :method => 'get', :path => "/projects/567/wiki/index" }, | |
610 | { :controller => 'wiki', :action => 'index', :project_id => '567' } |
|
601 | { :controller => 'wiki', :action => 'index', :project_id => '567' } | |
611 | ) |
|
602 | ) | |
612 | assert_routing( |
|
603 | assert_routing( | |
613 | { :method => 'get', :path => "/projects/567/wiki/date_index" }, |
|
604 | { :method => 'get', :path => "/projects/567/wiki/date_index" }, | |
614 | { :controller => 'wiki', :action => 'date_index', :project_id => '567' } |
|
605 | { :controller => 'wiki', :action => 'date_index', :project_id => '567' } | |
615 | ) |
|
606 | ) | |
616 | assert_routing( |
|
607 | assert_routing( | |
617 | { :method => 'get', :path => "/projects/567/wiki/export" }, |
|
608 | { :method => 'get', :path => "/projects/567/wiki/export" }, | |
618 | { :controller => 'wiki', :action => 'export', :project_id => '567' } |
|
609 | { :controller => 'wiki', :action => 'export', :project_id => '567' } | |
619 | ) |
|
610 | ) | |
620 | assert_routing( |
|
611 | assert_routing( | |
621 | { :method => 'post', :path => "/projects/567/wiki/CookBook_documentation/preview" }, |
|
612 | { :method => 'post', :path => "/projects/567/wiki/CookBook_documentation/preview" }, | |
622 | { :controller => 'wiki', :action => 'preview', :project_id => '567', |
|
613 | { :controller => 'wiki', :action => 'preview', :project_id => '567', | |
623 | :id => 'CookBook_documentation' } |
|
614 | :id => 'CookBook_documentation' } | |
624 | ) |
|
615 | ) | |
625 | assert_routing( |
|
616 | assert_routing( | |
626 | { :method => 'post', :path => "/projects/22/wiki/ladida/rename" }, |
|
617 | { :method => 'post', :path => "/projects/22/wiki/ladida/rename" }, | |
627 | { :controller => 'wiki', :action => 'rename', :project_id => '22', |
|
618 | { :controller => 'wiki', :action => 'rename', :project_id => '22', | |
628 | :id => 'ladida' } |
|
619 | :id => 'ladida' } | |
629 | ) |
|
620 | ) | |
630 | assert_routing( |
|
621 | assert_routing( | |
631 | { :method => 'post', :path => "/projects/22/wiki/ladida/protect" }, |
|
622 | { :method => 'post', :path => "/projects/22/wiki/ladida/protect" }, | |
632 | { :controller => 'wiki', :action => 'protect', :project_id => '22', |
|
623 | { :controller => 'wiki', :action => 'protect', :project_id => '22', | |
633 | :id => 'ladida' } |
|
624 | :id => 'ladida' } | |
634 | ) |
|
625 | ) | |
635 | assert_routing( |
|
626 | assert_routing( | |
636 | { :method => 'post', :path => "/projects/22/wiki/ladida/add_attachment" }, |
|
627 | { :method => 'post', :path => "/projects/22/wiki/ladida/add_attachment" }, | |
637 | { :controller => 'wiki', :action => 'add_attachment', :project_id => '22', |
|
628 | { :controller => 'wiki', :action => 'add_attachment', :project_id => '22', | |
638 | :id => 'ladida' } |
|
629 | :id => 'ladida' } | |
639 | ) |
|
630 | ) | |
640 | assert_routing( |
|
631 | assert_routing( | |
641 | { :method => 'put', :path => "/projects/567/wiki/my_page" }, |
|
632 | { :method => 'put', :path => "/projects/567/wiki/my_page" }, | |
642 | { :controller => 'wiki', :action => 'update', :project_id => '567', |
|
633 | { :controller => 'wiki', :action => 'update', :project_id => '567', | |
643 | :id => 'my_page' } |
|
634 | :id => 'my_page' } | |
644 | ) |
|
635 | ) | |
645 | assert_routing( |
|
636 | assert_routing( | |
646 | { :method => 'delete', :path => "/projects/22/wiki/ladida" }, |
|
637 | { :method => 'delete', :path => "/projects/22/wiki/ladida" }, | |
647 | { :controller => 'wiki', :action => 'destroy', :project_id => '22', |
|
638 | { :controller => 'wiki', :action => 'destroy', :project_id => '22', | |
648 | :id => 'ladida' } |
|
639 | :id => 'ladida' } | |
649 | ) |
|
640 | ) | |
650 | end |
|
641 | end | |
651 |
|
642 | |||
652 | def test_wikis_plural_admin_setup |
|
643 | def test_wikis_plural_admin_setup | |
653 | assert_routing( |
|
644 | assert_routing( | |
654 | { :method => 'get', :path => "/projects/ladida/wiki/destroy" }, |
|
645 | { :method => 'get', :path => "/projects/ladida/wiki/destroy" }, | |
655 | { :controller => 'wikis', :action => 'destroy', :id => 'ladida' } |
|
646 | { :controller => 'wikis', :action => 'destroy', :id => 'ladida' } | |
656 | ) |
|
647 | ) | |
657 | assert_routing( |
|
648 | assert_routing( | |
658 | { :method => 'post', :path => "/projects/ladida/wiki" }, |
|
649 | { :method => 'post', :path => "/projects/ladida/wiki" }, | |
659 | { :controller => 'wikis', :action => 'edit', :id => 'ladida' } |
|
650 | { :controller => 'wikis', :action => 'edit', :id => 'ladida' } | |
660 | ) |
|
651 | ) | |
661 | assert_routing( |
|
652 | assert_routing( | |
662 | { :method => 'post', :path => "/projects/ladida/wiki/destroy" }, |
|
653 | { :method => 'post', :path => "/projects/ladida/wiki/destroy" }, | |
663 | { :controller => 'wikis', :action => 'destroy', :id => 'ladida' } |
|
654 | { :controller => 'wikis', :action => 'destroy', :id => 'ladida' } | |
664 | ) |
|
655 | ) | |
665 | end |
|
656 | end | |
666 | end |
|
657 | end |
General Comments 0
You need to be logged in to leave comments.
Login now