Skip to content

Instantly share code, notes, and snippets.

@newacct
Forked from darkhelmet/cucumber-eval.rb
Created February 3, 2011 06:58
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 newacct/809144 to your computer and use it in GitHub Desktop.
Save newacct/809144 to your computer and use it in GitHub Desktop.
Then /^I should be editing "([^\"]*)"$/ do |login|
URI.parse(current_url).path.should == edit_user_path(User.find_by_login(login))
end
Then /^I should be viewing "([^\"]*)"$/ do |login|
URI.parse(current_url).path.should == user_path(User.find_by_login(login))
end
Then /^I should be (editing|viewing) "([^\"]*)"$/ do |method,login|
func = (method == 'editing' ? 'edit_' : '') + 'user_path'
URI.parse(current_url).path.should == send(func.to_sym, User.find_by_login(login))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment