@@ -38,13 +38,6 class AdminControllerTest < ActionController::TestCase | |||||
38 | :attributes => { :class => /nodata/ } |
|
38 | :attributes => { :class => /nodata/ } | |
39 | end |
|
39 | end | |
40 |
|
40 | |||
41 | def test_projects_routing |
|
|||
42 | assert_routing( |
|
|||
43 | {:method => :get, :path => '/admin/projects'}, |
|
|||
44 | :controller => 'admin', :action => 'projects' |
|
|||
45 | ) |
|
|||
46 | end |
|
|||
47 |
|
||||
48 | def test_index_with_no_configuration_data |
|
41 | def test_index_with_no_configuration_data | |
49 | delete_configuration_data |
|
42 | delete_configuration_data | |
50 | get :index |
|
43 | get :index |
@@ -1288,13 +1288,6 class IssuesControllerTest < ActionController::TestCase | |||||
1288 | assert_not_nil assigns(:notes) |
|
1288 | assert_not_nil assigns(:notes) | |
1289 | end |
|
1289 | end | |
1290 |
|
1290 | |||
1291 | def test_auto_complete_routing |
|
|||
1292 | assert_routing( |
|
|||
1293 | {:method => :get, :path => '/issues/auto_complete'}, |
|
|||
1294 | :controller => 'issues', :action => 'auto_complete' |
|
|||
1295 | ) |
|
|||
1296 | end |
|
|||
1297 |
|
||||
1298 | def test_auto_complete_should_not_be_case_sensitive |
|
1291 | def test_auto_complete_should_not_be_case_sensitive | |
1299 | get :auto_complete, :project_id => 'ecookbook', :q => 'ReCiPe' |
|
1292 | get :auto_complete, :project_id => 'ecookbook', :q => 'ReCiPe' | |
1300 | assert_response :success |
|
1293 | assert_response :success | |
@@ -1309,13 +1302,6 class IssuesControllerTest < ActionController::TestCase | |||||
1309 | assert assigns(:issues).include?(Issue.find(13)) |
|
1302 | assert assigns(:issues).include?(Issue.find(13)) | |
1310 | end |
|
1303 | end | |
1311 |
|
1304 | |||
1312 | def test_destroy_routing |
|
|||
1313 | assert_recognizes( #TODO: use DELETE on issue URI (need to change forms) |
|
|||
1314 | {:controller => 'issues', :action => 'destroy', :id => '1'}, |
|
|||
1315 | {:method => :post, :path => '/issues/1/destroy'} |
|
|||
1316 | ) |
|
|||
1317 | end |
|
|||
1318 |
|
||||
1319 | def test_destroy_issue_with_no_time_entries |
|
1305 | def test_destroy_issue_with_no_time_entries | |
1320 | assert_nil TimeEntry.find_by_issue_id(2) |
|
1306 | assert_nil TimeEntry.find_by_issue_id(2) | |
1321 | @request.session[:user_id] = 2 |
|
1307 | @request.session[:user_id] = 2 |
@@ -34,21 +34,6 class UsersControllerTest < ActionController::TestCase | |||||
34 | @request.session[:user_id] = 1 # admin |
|
34 | @request.session[:user_id] = 1 # admin | |
35 | end |
|
35 | end | |
36 |
|
36 | |||
37 | def test_index_routing |
|
|||
38 | assert_generates( |
|
|||
39 | '/users', |
|
|||
40 | :controller => 'users', :action => 'index' |
|
|||
41 | ) |
|
|||
42 | assert_routing( |
|
|||
43 | {:method => :get, :path => '/users'}, |
|
|||
44 | :controller => 'users', :action => 'index' |
|
|||
45 | ) |
|
|||
46 | assert_recognizes( |
|
|||
47 | {:controller => 'users', :action => 'index'}, |
|
|||
48 | {:method => :get, :path => '/users'} |
|
|||
49 | ) |
|
|||
50 | end |
|
|||
51 |
|
||||
52 | def test_index |
|
37 | def test_index | |
53 | get :index |
|
38 | get :index | |
54 | assert_response :success |
|
39 | assert_response :success | |
@@ -74,17 +59,6 class UsersControllerTest < ActionController::TestCase | |||||
74 | assert_equal 'John', users.first.firstname |
|
59 | assert_equal 'John', users.first.firstname | |
75 | end |
|
60 | end | |
76 |
|
61 | |||
77 | def test_show_routing |
|
|||
78 | assert_routing( |
|
|||
79 | {:method => :get, :path => '/users/44'}, |
|
|||
80 | :controller => 'users', :action => 'show', :id => '44' |
|
|||
81 | ) |
|
|||
82 | assert_recognizes( |
|
|||
83 | {:controller => 'users', :action => 'show', :id => '44'}, |
|
|||
84 | {:method => :get, :path => '/users/44'} |
|
|||
85 | ) |
|
|||
86 | end |
|
|||
87 |
|
||||
88 | def test_show |
|
62 | def test_show | |
89 | @request.session[:user_id] = nil |
|
63 | @request.session[:user_id] = nil | |
90 | get :show, :id => 2 |
|
64 | get :show, :id => 2 | |
@@ -123,38 +97,6 class UsersControllerTest < ActionController::TestCase | |||||
123 | assert_not_nil assigns(:user) |
|
97 | assert_not_nil assigns(:user) | |
124 | end |
|
98 | end | |
125 |
|
99 | |||
126 | def test_add_routing |
|
|||
127 | assert_routing( |
|
|||
128 | {:method => :get, :path => '/users/new'}, |
|
|||
129 | :controller => 'users', :action => 'add' |
|
|||
130 | ) |
|
|||
131 | assert_recognizes( |
|
|||
132 | #TODO: remove this and replace with POST to collection, need to modify form |
|
|||
133 | {:controller => 'users', :action => 'add'}, |
|
|||
134 | {:method => :post, :path => '/users/new'} |
|
|||
135 | ) |
|
|||
136 | assert_recognizes( |
|
|||
137 | {:controller => 'users', :action => 'add'}, |
|
|||
138 | {:method => :post, :path => '/users'} |
|
|||
139 | ) |
|
|||
140 | end |
|
|||
141 |
|
||||
142 | def test_edit_routing |
|
|||
143 | assert_routing( |
|
|||
144 | {:method => :get, :path => '/users/444/edit'}, |
|
|||
145 | :controller => 'users', :action => 'edit', :id => '444' |
|
|||
146 | ) |
|
|||
147 | assert_routing( |
|
|||
148 | {:method => :get, :path => '/users/222/edit/membership'}, |
|
|||
149 | :controller => 'users', :action => 'edit', :id => '222', :tab => 'membership' |
|
|||
150 | ) |
|
|||
151 | assert_recognizes( |
|
|||
152 | #TODO: use PUT on user_path, modify form |
|
|||
153 | {:controller => 'users', :action => 'edit', :id => '444'}, |
|
|||
154 | {:method => :post, :path => '/users/444/edit'} |
|
|||
155 | ) |
|
|||
156 | end |
|
|||
157 |
|
||||
158 | def test_edit |
|
100 | def test_edit | |
159 | ActionMailer::Base.deliveries.clear |
|
101 | ActionMailer::Base.deliveries.clear | |
160 | post :edit, :id => 2, :user => {:firstname => 'Changed'} |
|
102 | post :edit, :id => 2, :user => {:firstname => 'Changed'} | |
@@ -192,20 +134,6 class UsersControllerTest < ActionController::TestCase | |||||
192 | assert mail.body.include?('newpass') |
|
134 | assert mail.body.include?('newpass') | |
193 | end |
|
135 | end | |
194 |
|
136 | |||
195 | def test_add_membership_routing |
|
|||
196 | assert_routing( |
|
|||
197 | {:method => :post, :path => '/users/123/memberships'}, |
|
|||
198 | :controller => 'users', :action => 'edit_membership', :id => '123' |
|
|||
199 | ) |
|
|||
200 | end |
|
|||
201 |
|
||||
202 | def test_edit_membership_routing |
|
|||
203 | assert_routing( |
|
|||
204 | {:method => :post, :path => '/users/123/memberships/55'}, |
|
|||
205 | :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55' |
|
|||
206 | ) |
|
|||
207 | end |
|
|||
208 |
|
||||
209 | def test_edit_membership |
|
137 | def test_edit_membership | |
210 | post :edit_membership, :id => 2, :membership_id => 1, |
|
138 | post :edit_membership, :id => 2, :membership_id => 1, | |
211 | :membership => { :role_ids => [2]} |
|
139 | :membership => { :role_ids => [2]} | |
@@ -214,14 +142,6 class UsersControllerTest < ActionController::TestCase | |||||
214 | end |
|
142 | end | |
215 |
|
143 | |||
216 | def test_destroy_membership |
|
144 | def test_destroy_membership | |
217 | assert_routing( |
|
|||
218 | #TODO: use DELETE method on user_membership_path, modify form |
|
|||
219 | {:method => :post, :path => '/users/567/memberships/12/destroy'}, |
|
|||
220 | :controller => 'users', :action => 'destroy_membership', :id => '567', :membership_id => '12' |
|
|||
221 | ) |
|
|||
222 | end |
|
|||
223 |
|
||||
224 | def test_destroy_membership |
|
|||
225 | post :destroy_membership, :id => 2, :membership_id => 1 |
|
145 | post :destroy_membership, :id => 2, :membership_id => 1 | |
226 | assert_redirected_to :action => 'edit', :id => '2', :tab => 'memberships' |
|
146 | assert_redirected_to :action => 'edit', :id => '2', :tab => 'memberships' | |
227 | assert_nil Member.find_by_id(1) |
|
147 | assert_nil Member.find_by_id(1) |
@@ -40,17 +40,6 class VersionsControllerTest < ActionController::TestCase | |||||
40 | assert_tag :tag => 'h2', :content => /1.0/ |
|
40 | assert_tag :tag => 'h2', :content => /1.0/ | |
41 | end |
|
41 | end | |
42 |
|
42 | |||
43 | def test_new_routing |
|
|||
44 | assert_routing( |
|
|||
45 | {:method => :get, :path => 'projects/foo/versions/new'}, |
|
|||
46 | :controller => 'versions', :action => 'new', :project_id => 'foo' |
|
|||
47 | ) |
|
|||
48 | assert_routing( |
|
|||
49 | {:method => :post, :path => 'projects/foo/versions/new'}, |
|
|||
50 | :controller => 'versions', :action => 'new', :project_id => 'foo' |
|
|||
51 | ) |
|
|||
52 | end |
|
|||
53 |
|
||||
54 | def test_new |
|
43 | def test_new | |
55 | @request.session[:user_id] = 2 # manager |
|
44 | @request.session[:user_id] = 2 # manager | |
56 | assert_difference 'Version.count' do |
|
45 | assert_difference 'Version.count' do |
@@ -31,21 +31,6 class WikiControllerTest < ActionController::TestCase | |||||
31 | User.current = nil |
|
31 | User.current = nil | |
32 | end |
|
32 | end | |
33 |
|
33 | |||
34 | def test_index_routing |
|
|||
35 | assert_routing( |
|
|||
36 | {:method => :get, :path => '/projects/567/wiki'}, |
|
|||
37 | :controller => 'wiki', :action => 'index', :id => '567' |
|
|||
38 | ) |
|
|||
39 | assert_routing( |
|
|||
40 | {:method => :get, :path => '/projects/567/wiki/lalala'}, |
|
|||
41 | :controller => 'wiki', :action => 'index', :id => '567', :page => 'lalala' |
|
|||
42 | ) |
|
|||
43 | assert_generates( |
|
|||
44 | '/projects/567/wiki', |
|
|||
45 | :controller => 'wiki', :action => 'index', :id => '567', :page => nil |
|
|||
46 | ) |
|
|||
47 | end |
|
|||
48 |
|
||||
49 | def test_show_start_page |
|
34 | def test_show_start_page | |
50 | get :index, :id => 'ecookbook' |
|
35 | get :index, :id => 'ecookbook' | |
51 | assert_response :success |
|
36 | assert_response :success | |
@@ -93,17 +78,6 class WikiControllerTest < ActionController::TestCase | |||||
93 | assert_template 'edit' |
|
78 | assert_template 'edit' | |
94 | end |
|
79 | end | |
95 |
|
80 | |||
96 | def test_edit_routing |
|
|||
97 | assert_routing( |
|
|||
98 | {:method => :get, :path => '/projects/567/wiki/my_page/edit'}, |
|
|||
99 | :controller => 'wiki', :action => 'edit', :id => '567', :page => 'my_page' |
|
|||
100 | ) |
|
|||
101 | assert_recognizes(#TODO: use PUT to page path, adjust forms accordingly |
|
|||
102 | {:controller => 'wiki', :action => 'edit', :id => '567', :page => 'my_page'}, |
|
|||
103 | {:method => :post, :path => '/projects/567/wiki/my_page/edit'} |
|
|||
104 | ) |
|
|||
105 | end |
|
|||
106 |
|
||||
107 | def test_create_page |
|
81 | def test_create_page | |
108 | @request.session[:user_id] = 2 |
|
82 | @request.session[:user_id] = 2 | |
109 | post :edit, :id => 1, |
|
83 | post :edit, :id => 1, | |
@@ -135,13 +109,6 class WikiControllerTest < ActionController::TestCase | |||||
135 | assert_equal 'testfile.txt', page.attachments.first.filename |
|
109 | assert_equal 'testfile.txt', page.attachments.first.filename | |
136 | end |
|
110 | end | |
137 |
|
111 | |||
138 | def test_preview_routing |
|
|||
139 | assert_routing( |
|
|||
140 | {:method => :post, :path => '/projects/567/wiki/CookBook_documentation/preview'}, |
|
|||
141 | :controller => 'wiki', :action => 'preview', :id => '567', :page => 'CookBook_documentation' |
|
|||
142 | ) |
|
|||
143 | end |
|
|||
144 |
|
||||
145 | def test_preview |
|
112 | def test_preview | |
146 | @request.session[:user_id] = 2 |
|
113 | @request.session[:user_id] = 2 | |
147 | xhr :post, :preview, :id => 1, :page => 'CookBook_documentation', |
|
114 | xhr :post, :preview, :id => 1, :page => 'CookBook_documentation', | |
@@ -164,13 +131,6 class WikiControllerTest < ActionController::TestCase | |||||
164 | assert_tag :tag => 'h1', :content => /New page/ |
|
131 | assert_tag :tag => 'h1', :content => /New page/ | |
165 | end |
|
132 | end | |
166 |
|
133 | |||
167 | def test_history_routing |
|
|||
168 | assert_routing( |
|
|||
169 | {:method => :get, :path => '/projects/1/wiki/CookBook_documentation/history'}, |
|
|||
170 | :controller => 'wiki', :action => 'history', :id => '1', :page => 'CookBook_documentation' |
|
|||
171 | ) |
|
|||
172 | end |
|
|||
173 |
|
||||
174 | def test_history |
|
134 | def test_history | |
175 | get :history, :id => 1, :page => 'CookBook_documentation' |
|
135 | get :history, :id => 1, :page => 'CookBook_documentation' | |
176 | assert_response :success |
|
136 | assert_response :success | |
@@ -189,13 +149,6 class WikiControllerTest < ActionController::TestCase | |||||
189 | assert_select "input[type=submit][name=commit]", false |
|
149 | assert_select "input[type=submit][name=commit]", false | |
190 | end |
|
150 | end | |
191 |
|
151 | |||
192 | def test_diff_routing |
|
|||
193 | assert_routing( |
|
|||
194 | {:method => :get, :path => '/projects/1/wiki/CookBook_documentation/diff/2/vs/1'}, |
|
|||
195 | :controller => 'wiki', :action => 'diff', :id => '1', :page => 'CookBook_documentation', :version => '2', :version_from => '1' |
|
|||
196 | ) |
|
|||
197 | end |
|
|||
198 |
|
||||
199 | def test_diff |
|
152 | def test_diff | |
200 | get :diff, :id => 1, :page => 'CookBook_documentation', :version => 2, :version_from => 1 |
|
153 | get :diff, :id => 1, :page => 'CookBook_documentation', :version => 2, :version_from => 1 | |
201 | assert_response :success |
|
154 | assert_response :success | |
@@ -204,13 +157,6 class WikiControllerTest < ActionController::TestCase | |||||
204 | :content => /updated/ |
|
157 | :content => /updated/ | |
205 | end |
|
158 | end | |
206 |
|
159 | |||
207 | def test_annotate_routing |
|
|||
208 | assert_routing( |
|
|||
209 | {:method => :get, :path => '/projects/1/wiki/CookBook_documentation/annotate/2'}, |
|
|||
210 | :controller => 'wiki', :action => 'annotate', :id => '1', :page => 'CookBook_documentation', :version => '2' |
|
|||
211 | ) |
|
|||
212 | end |
|
|||
213 |
|
||||
214 | def test_annotate |
|
160 | def test_annotate | |
215 | get :annotate, :id => 1, :page => 'CookBook_documentation', :version => 2 |
|
161 | get :annotate, :id => 1, :page => 'CookBook_documentation', :version => 2 | |
216 | assert_response :success |
|
162 | assert_response :success | |
@@ -225,18 +171,6 class WikiControllerTest < ActionController::TestCase | |||||
225 | :child => { :tag => 'td', :content => /Some updated \[\[documentation\]\] here/ } |
|
171 | :child => { :tag => 'td', :content => /Some updated \[\[documentation\]\] here/ } | |
226 | end |
|
172 | end | |
227 |
|
173 | |||
228 | def test_rename_routing |
|
|||
229 | assert_routing( |
|
|||
230 | {:method => :get, :path => '/projects/22/wiki/ladida/rename'}, |
|
|||
231 | :controller => 'wiki', :action => 'rename', :id => '22', :page => 'ladida' |
|
|||
232 | ) |
|
|||
233 | assert_recognizes( |
|
|||
234 | #TODO: should be moved into a update action and use a PUT to the page URI |
|
|||
235 | {:controller => 'wiki', :action => 'rename', :id => '22', :page => 'ladida'}, |
|
|||
236 | {:method => :post, :path => '/projects/22/wiki/ladida/rename'} |
|
|||
237 | ) |
|
|||
238 | end |
|
|||
239 |
|
||||
240 | def test_rename_with_redirect |
|
174 | def test_rename_with_redirect | |
241 | @request.session[:user_id] = 2 |
|
175 | @request.session[:user_id] = 2 | |
242 | post :rename, :id => 1, :page => 'Another_page', |
|
176 | post :rename, :id => 1, :page => 'Another_page', | |
@@ -260,14 +194,6 class WikiControllerTest < ActionController::TestCase | |||||
260 | assert_nil wiki.find_page('Another page') |
|
194 | assert_nil wiki.find_page('Another page') | |
261 | end |
|
195 | end | |
262 |
|
196 | |||
263 | def test_destroy_routing |
|
|||
264 | assert_recognizes( |
|
|||
265 | #TODO: should use DELETE on page URI |
|
|||
266 | {:controller => 'wiki', :action => 'destroy', :id => '22', :page => 'ladida'}, |
|
|||
267 | {:method => :post, :path => 'projects/22/wiki/ladida/destroy'} |
|
|||
268 | ) |
|
|||
269 | end |
|
|||
270 |
|
||||
271 | def test_destroy_child |
|
197 | def test_destroy_child | |
272 | @request.session[:user_id] = 2 |
|
198 | @request.session[:user_id] = 2 | |
273 | post :destroy, :id => 1, :page => 'Child_1' |
|
199 | post :destroy, :id => 1, :page => 'Child_1' | |
@@ -312,25 +238,6 class WikiControllerTest < ActionController::TestCase | |||||
312 | assert_equal WikiPage.find(1), WikiPage.find_by_id(5).parent |
|
238 | assert_equal WikiPage.find(1), WikiPage.find_by_id(5).parent | |
313 | end |
|
239 | end | |
314 |
|
240 | |||
315 | def test_special_routing |
|
|||
316 | assert_routing( |
|
|||
317 | {:method => :get, :path => '/projects/567/wiki/page_index'}, |
|
|||
318 | :controller => 'wiki', :action => 'special', :id => '567', :page => 'page_index' |
|
|||
319 | ) |
|
|||
320 | assert_routing( |
|
|||
321 | {:method => :get, :path => '/projects/567/wiki/Page_Index'}, |
|
|||
322 | :controller => 'wiki', :action => 'special', :id => '567', :page => 'Page_Index' |
|
|||
323 | ) |
|
|||
324 | assert_routing( |
|
|||
325 | {:method => :get, :path => '/projects/567/wiki/date_index'}, |
|
|||
326 | :controller => 'wiki', :action => 'special', :id => '567', :page => 'date_index' |
|
|||
327 | ) |
|
|||
328 | assert_routing( |
|
|||
329 | {:method => :get, :path => '/projects/567/wiki/export'}, |
|
|||
330 | :controller => 'wiki', :action => 'special', :id => '567', :page => 'export' |
|
|||
331 | ) |
|
|||
332 | end |
|
|||
333 |
|
||||
334 | def test_page_index |
|
241 | def test_page_index | |
335 | get :special, :id => 'ecookbook', :page => 'Page_index' |
|
242 | get :special, :id => 'ecookbook', :page => 'Page_index' | |
336 | assert_response :success |
|
243 | assert_response :success | |
@@ -355,13 +262,6 class WikiControllerTest < ActionController::TestCase | |||||
355 | assert_response 404 |
|
262 | assert_response 404 | |
356 | end |
|
263 | end | |
357 |
|
264 | |||
358 | def test_protect_routing |
|
|||
359 | assert_routing( |
|
|||
360 | {:method => :post, :path => 'projects/22/wiki/ladida/protect'}, |
|
|||
361 | {:controller => 'wiki', :action => 'protect', :id => '22', :page => 'ladida'} |
|
|||
362 | ) |
|
|||
363 | end |
|
|||
364 |
|
||||
365 | def test_protect_page |
|
265 | def test_protect_page | |
366 | page = WikiPage.find_by_wiki_id_and_title(1, 'Another_page') |
|
266 | page = WikiPage.find_by_wiki_id_and_title(1, 'Another_page') | |
367 | assert !page.protected? |
|
267 | assert !page.protected? |
@@ -59,10 +59,56 class RoutingTest < ActionController::IntegrationTest | |||||
59 | should_route :post, "/issues/gantt", :controller => 'issues', :action => 'gantt' |
|
59 | should_route :post, "/issues/gantt", :controller => 'issues', :action => 'gantt' | |
60 | should_route :get, "/projects/project-name/issues/gantt", :controller => 'issues', :action => 'gantt', :project_id => 'project-name' |
|
60 | should_route :get, "/projects/project-name/issues/gantt", :controller => 'issues', :action => 'gantt', :project_id => 'project-name' | |
61 | should_route :post, "/projects/project-name/issues/gantt", :controller => 'issues', :action => 'gantt', :project_id => 'project-name' |
|
61 | should_route :post, "/projects/project-name/issues/gantt", :controller => 'issues', :action => 'gantt', :project_id => 'project-name' | |
|
62 | ||||
|
63 | should_route :get, "/issues/auto_complete", :controller => 'issues', :action => 'auto_complete' | |||
62 | end |
|
64 | end | |
63 |
|
65 | |||
64 | context "issue reports" do |
|
66 | context "issue reports" do | |
65 | should_route :get, "/projects/567/issues/report", :controller => 'reports', :action => 'issue_report', :id => '567' |
|
67 | should_route :get, "/projects/567/issues/report", :controller => 'reports', :action => 'issue_report', :id => '567' | |
66 | should_route :get, "/projects/567/issues/report/assigned_to", :controller => 'reports', :action => 'issue_report_details', :id => '567', :detail => 'assigned_to' |
|
68 | should_route :get, "/projects/567/issues/report/assigned_to", :controller => 'reports', :action => 'issue_report_details', :id => '567', :detail => 'assigned_to' | |
67 | end |
|
69 | end | |
|
70 | ||||
|
71 | context "users" do | |||
|
72 | should_route :get, "/users", :controller => 'users', :action => 'index' | |||
|
73 | should_route :get, "/users/44", :controller => 'users', :action => 'show', :id => '44' | |||
|
74 | should_route :get, "/users/new", :controller => 'users', :action => 'add' | |||
|
75 | should_route :get, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444' | |||
|
76 | should_route :get, "/users/222/edit/membership", :controller => 'users', :action => 'edit', :id => '222', :tab => 'membership' | |||
|
77 | ||||
|
78 | should_route :post, "/users/new", :controller => 'users', :action => 'add' | |||
|
79 | should_route :post, "/users/444/edit", :controller => 'users', :action => 'edit', :id => '444' | |||
|
80 | should_route :post, "/users/123/memberships", :controller => 'users', :action => 'edit_membership', :id => '123' | |||
|
81 | should_route :post, "/users/123/memberships/55", :controller => 'users', :action => 'edit_membership', :id => '123', :membership_id => '55' | |||
|
82 | should_route :post, "/users/567/memberships/12/destroy", :controller => 'users', :action => 'destroy_membership', :id => '567', :membership_id => '12' | |||
|
83 | end | |||
|
84 | ||||
|
85 | context "versions" do | |||
|
86 | should_route :get, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo' | |||
|
87 | ||||
|
88 | should_route :post, "/projects/foo/versions/new", :controller => 'versions', :action => 'new', :project_id => 'foo' | |||
|
89 | end | |||
|
90 | ||||
|
91 | context "wikis" do | |||
|
92 | should_route :get, "/projects/567/wiki", :controller => 'wiki', :action => 'index', :id => '567' | |||
|
93 | should_route :get, "/projects/567/wiki/lalala", :controller => 'wiki', :action => 'index', :id => '567', :page => 'lalala' | |||
|
94 | should_route :get, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :id => '567', :page => 'my_page' | |||
|
95 | should_route :get, "/projects/1/wiki/CookBook_documentation/history", :controller => 'wiki', :action => 'history', :id => '1', :page => 'CookBook_documentation' | |||
|
96 | should_route :get, "/projects/1/wiki/CookBook_documentation/diff/2/vs/1", :controller => 'wiki', :action => 'diff', :id => '1', :page => 'CookBook_documentation', :version => '2', :version_from => '1' | |||
|
97 | should_route :get, "/projects/1/wiki/CookBook_documentation/annotate/2", :controller => 'wiki', :action => 'annotate', :id => '1', :page => 'CookBook_documentation', :version => '2' | |||
|
98 | should_route :get, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :id => '22', :page => 'ladida' | |||
|
99 | should_route :get, "/projects/567/wiki/page_index", :controller => 'wiki', :action => 'special', :id => '567', :page => 'page_index' | |||
|
100 | should_route :get, "/projects/567/wiki/Page_Index", :controller => 'wiki', :action => 'special', :id => '567', :page => 'Page_Index' | |||
|
101 | should_route :get, "/projects/567/wiki/date_index", :controller => 'wiki', :action => 'special', :id => '567', :page => 'date_index' | |||
|
102 | should_route :get, "/projects/567/wiki/export", :controller => 'wiki', :action => 'special', :id => '567', :page => 'export' | |||
|
103 | ||||
|
104 | should_route :post, "/projects/567/wiki/my_page/edit", :controller => 'wiki', :action => 'edit', :id => '567', :page => 'my_page' | |||
|
105 | should_route :post, "/projects/567/wiki/CookBook_documentation/preview", :controller => 'wiki', :action => 'preview', :id => '567', :page => 'CookBook_documentation' | |||
|
106 | should_route :post, "/projects/22/wiki/ladida/rename", :controller => 'wiki', :action => 'rename', :id => '22', :page => 'ladida' | |||
|
107 | should_route :post, "/projects/22/wiki/ladida/destroy", :controller => 'wiki', :action => 'destroy', :id => '22', :page => 'ladida' | |||
|
108 | should_route :post, "/projects/22/wiki/ladida/protect", :controller => 'wiki', :action => 'protect', :id => '22', :page => 'ladida' | |||
|
109 | end | |||
|
110 | ||||
|
111 | context "administration panel" do | |||
|
112 | should_route :get, "/admin/projects", :controller => 'admin', :action => 'projects' | |||
|
113 | end | |||
68 | end |
|
114 | end |
General Comments 0
You need to be logged in to leave comments.
Login now