Setting instance variables from factories created using the steps defined in factory_girl/factory_girl_steps.rb

43 views
Skip to first unread message

Chris Bloom

unread,
Dec 23, 2011, 4:34:51 AM12/23/11
to factory_girl
I was looking for a way to use the cucumber steps that are delivered
with factory_girl, but have each generated object stored in an
instance variable to be accessed in other steps. I came across an old
Gist that did this based off of an older version of Fg, so I took the
time to update it with the current version of the factory_girl_step.rb
file and filled out some functionality that was missing from the
original. Thought I would mention it here in case it is useful to
someone else. You can find it at https://gist.github.com/1513688. If
the Fg core team is interested in including this functionality I can
easily create a pull request for the changes, which are minor. Also,
I'm just starting to hack on Cucumber so I'm open to any critiques
including why I might not want to do this in the first place. It
seemed like a good way to simplify my declarative scenarios.
Reply all
Reply to author
Forward
0 new messages