Skip to content

Instantly share code, notes, and snippets.

@ozgun
Created August 12, 2011 08:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ozgun/1141681 to your computer and use it in GitHub Desktop.
Save ozgun/1141681 to your computer and use it in GitHub Desktop.
cucumber - pickle - paths
# eg: I am on the advertisers ad campaign's the ad's edit page
when /^the (.+?) #{capture_model}(?:'s)? #{capture_model}(?:'s)? (.+?) page$/
polymorphic_path [$1.to_sym, model($2), model($3)], :action => $4
# eg: I am on the advertisers the ad campaign's the ad's page
when /^the (.+?) #{capture_model}(?:'s)? #{capture_model}(?:'s)? page$/
polymorphic_path [$1.to_sym, model($2), model($3)]
# eg: I am on the advertisers the ad's edit page
when /^the (.+?) #{capture_model}(?:'s)? (.+?) page$/
polymorphic_path [$1.to_sym, model($2)], :action => $3
# eg: I am on the advertisers the ad's page
when /^the (.+?) #{capture_model}(?:'s)? page$/
polymorphic_path [$1.to_sym, model($2)]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment