Reputation: 549
The answer for this question should be trivial. Is there any way to get in to the show action path to a given AR object within cucumber paths.(I am using factories to set up test AR objects).
I can refer in paths.rb new, edit and index paths but when it comes to show action it needs to specify the object and is there a way to refer that object on the paths.rb
Upvotes: 2
Views: 1019
Reputation: 576
I'm not entierly sure I understand the question - you want to be able to visit the 'show' page for a specific instance of a model?
Would somethign like this work? (taken from features/support/paths.rb)
when /the profile page for "([^\"]*)"/
user_path(User.find_by_username($1))
In this case, you will visit the 'show' action (profile page) of the username supplied in the Scenario.
Upvotes: 3