Skip to content
This repository
Browse code

Routes added under resource collection should be prefixed with

resource collection name
  • Loading branch information...
commit 3d91d7f0a2bd4b1e104dd8847a2fe9f206c916ca 1 parent 1fc58a8
Joshua Peek josh authored
2  actionpack/lib/action_dispatch/routing/mapper.rb
@@ -369,7 +369,7 @@ def collection
369 369 end
370 370
371 371 with_scope_level(:collection) do
372   - scope(:name_prefix => parent_resource.member_name, :as => "") do
  372 + scope(:name_prefix => parent_resource.collection_name, :as => "") do
373 373 yield
374 374 end
375 375 end
17 actionpack/test/dispatch/routing_test.rb
@@ -236,10 +236,7 @@ def test_projects_participants
236 236
237 237 put '/projects/1/participants/update_all'
238 238 assert_equal 'participants#update_all', @response.body
239   -
240   - pending do
241   - assert_equal '/projects/1/participants/update_all', update_all_project_participants_path(:project_id => '1')
242   - end
  239 + assert_equal '/projects/1/participants/update_all', update_all_project_participants_path(:project_id => '1')
243 240 end
244 241 end
245 242
@@ -309,15 +306,11 @@ def test_projects_posts
309 306
310 307 get '/projects/1/posts/archive'
311 308 assert_equal 'posts#archive', @response.body
312   - pending do
313   - assert_equal '/projects/1/posts/archive', archive_project_posts_path(:project_id => '1')
314   - end
  309 + assert_equal '/projects/1/posts/archive', archive_project_posts_path(:project_id => '1')
315 310
316 311 get '/projects/1/posts/toggle_view'
317 312 assert_equal 'posts#toggle_view', @response.body
318   - pending do
319   - assert_equal '/projects/1/posts/toggle_view', toggle_view_project_posts_path(:project_id => '1')
320   - end
  313 + assert_equal '/projects/1/posts/toggle_view', toggle_view_project_posts_path(:project_id => '1')
321 314
322 315 post '/projects/1/posts/1/preview'
323 316 assert_equal 'posts#preview', @response.body
@@ -333,9 +326,7 @@ def test_projects_posts
333 326
334 327 post '/projects/1/posts/1/comments/preview'
335 328 assert_equal 'comments#preview', @response.body
336   - pending do
337   - assert_equal '/projects/1/posts/1/comments/preview', preview_project_post_comments_path(:project_id => '1', :post_id => '1')
338   - end
  329 + assert_equal '/projects/1/posts/1/comments/preview', preview_project_post_comments_path(:project_id => '1', :post_id => '1')
339 330 end
340 331 end
341 332

0 comments on commit 3d91d7f

Please sign in to comment.
Something went wrong with that request. Please try again.