daily pastebin goal
41%
SHARE
TWEET

Untitled

a guest Jan 13th, 2018 48 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # in spec/routing/search_routing_spec.rb
  2.  
  3.   it "routes /search/users/foo/bar to search#users with name => foo, server => bar" do
  4.     { :get => '/search/users/foo/bar' }.should route_to(
  5.       :controller => "search",
  6.       :action => "users",
  7.       :name => "foo",
  8.       :server => "bar"
  9.     )
  10.   end
  11.  
  12. # in routes.rb
  13.  
  14.   get '/search/users/:name(/:server)' => 'search#users', :constraints => {
  15.       :name => /[^\/]+/,
  16.       :server => /[^\/]+/
  17.   }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top