Skip to content

Instantly share code, notes, and snippets.

@darkhelmet
Created August 29, 2009 23:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save darkhelmet/177757 to your computer and use it in GitHub Desktop.
Save darkhelmet/177757 to your computer and use it in GitHub Desktop.
Then /^I should be (editing|viewing) "([^\"]*)"$/ do |method,login|
func = (method == 'editing' ? 'edit_' : '') + 'user_path'
URI.parse(current_url).path.should == eval("#{func}(User.find_by_login(login))")
end
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment