Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # in spec/routing/search_routing_spec.rb
- it "routes /search/users/foo/bar to search#users with name => foo, server => bar" do
- { :get => '/search/users/foo/bar' }.should route_to(
- :controller => "search",
- :action => "users",
- :name => "foo",
- :server => "bar"
- )
- end
- # in routes.rb
- get '/search/users/:name(/:server)' => 'search#users', :constraints => {
- :name => /[^\/]+/,
- :server => /[^\/]+/
- }
Add Comment
Please, Sign In to add comment