Skip to content

Commit

Permalink
Add additional tests for #13824
Browse files Browse the repository at this point in the history
  • Loading branch information
pixeltrix committed Jan 25, 2014
1 parent 345555c commit a31a44a
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions actionpack/test/dispatch/routing_test.rb
Expand Up @@ -2932,6 +2932,32 @@ def test_shorthand_route_with_dashes_in_path
assert_equal '/about-us/index', about_us_index_path assert_equal '/about-us/index', about_us_index_path
end end


def test_resource_routes_with_dashes_in_path
draw do
resources :photos, only: [:show] do
get 'user-favorites', on: :collection
get 'preview-photo', on: :member
get 'summary-text'
end
end

get '/photos/user-favorites'
assert_equal 'photos#user_favorites', @response.body
assert_equal '/photos/user-favorites', user_favorites_photos_path

get '/photos/1/preview-photo'
assert_equal 'photos#preview_photo', @response.body
assert_equal '/photos/1/preview-photo', preview_photo_photo_path('1')

get '/photos/1/summary-text'
assert_equal 'photos#summary_text', @response.body
assert_equal '/photos/1/summary-text', photo_summary_text_path('1')

get '/photos/1'
assert_equal 'photos#show', @response.body
assert_equal '/photos/1', photo_path('1')
end

private private


def draw(&block) def draw(&block)
Expand Down

0 comments on commit a31a44a

Please sign in to comment.