Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Route issue #4585

Closed
jacoz opened this issue Jan 21, 2012 · 3 comments
Closed

Route issue #4585

jacoz opened this issue Jan 21, 2012 · 3 comments
Milestone

Comments

@jacoz
Copy link

jacoz commented Jan 21, 2012

Hi,
I've just update my env to rails 3.2.0.

With rails 3.1.3 I had this route: 'get ":artist/:song-lyrics" => "songs#show"', and in my controller I got 2 params: artist and song; but now it doesn't work anymore!
If I remove "-lyrics" it does.

thanks!

@bigcurl
Copy link

bigcurl commented Jan 23, 2012

+1

I have the following routes.

 scope '/:locale' do
    get '/' => "events#index", :as => :events
    get '/:id-in-:area' => "events#show", :constraints => { :id => /\d.+/ }, :as => :event
    get '/was-geht-heute-in-:area' => "events#index", :as => :area
    get '/was-geht-demnaechst-in-:area' => "events#in_the_future", :as => :in_the_future_events
end

The first three work, the last one does not. I do not have an appended string like jan267.

@josevalim
Copy link
Contributor

Hey guys, can you provide a test case to Rails test suite? You can find many route tests here:

https://github.com/rails/rails/blob/master/actionpack/test/dispatch/routing_test.rb

You just need to add your own.

rafaelfranca added a commit to rafaelfranca/omg-rails that referenced this issue Jan 23, 2012
rafaelfranca added a commit to rafaelfranca/omg-rails that referenced this issue Jan 23, 2012
@jacoz
Copy link
Author

jacoz commented Jan 23, 2012

Yeah, sure!

test "should route to song" do
    assert_routing '/katy-perry/the-one-that-got-away-lyrics', { :controller => "songs", :action => "show", :artist => "katy-perry", :song => "the-one-that-got-away" }
end

test result:

  1) Error:
test_should_route_to_song(RoutesTest):
ActionController::RoutingError: No route matches "/katy-perry/the-one-that-got-away-lyrics"
    /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.0/lib/action_dispatch/routing/route_set.rb:603:in `recognize_path'
    /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.0/lib/action_dispatch/testing/assertions/routing.rb:210:in `recognized_request_for'
    /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.0/lib/action_dispatch/testing/assertions/routing.rb:42:in `assert_recognizes'
    /usr/local/lib/ruby/gems/1.9.1/gems/actionpack-3.2.0/lib/action_dispatch/testing/assertions/routing.rb:118:in `assert_routing'
    test/functional/routes_test.rb:5:in `block in <class:RoutesTest>'

Thanks!

bronzle pushed a commit to bronzle/rails that referenced this issue Jan 24, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants