Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.