Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Request in the feature -> ... the user show "foo" page by "login"
- # -> features/support/paths.rb
- when /^the (.*) (edit|show)( "([^\"]*)")? page by "([^\"]*)"$/i
- case $2
- when "edit","show"
- klass = $1.singularize.capitalize.constantize
- obj = klass.send("find_by_#{$5.singularize}", $4) if $4 && $5
- raise "could not find #{$3} #{$1}" unless obj
- return self.send("edit_#{$1.downcase.singularize}_path",obj) if $2=="edit"
- return self.send("#{$1.singularize}_path",obj) if $2=="show"
- end
- when /^the (.*) (overview|new)( "([^\"]*)")? page$/i
- case $2
- when "new"
- self.send("new_#{$1.downcase.singularize}_path")
- when "overview"
- self.send("#{$1.downcase.pluralize}_path")
- end
Add Comment
Please, Sign In to add comment