[rspec-users] Cucumber - stub! or mock?
tim at pivotib.com
Wed Sep 17 11:33:22 EDT 2008
> Why don't use just use a slug for these things? In other words - use
> a unique name for each record, since the numbers 10 and 11 don't
> mean much to anyone.
> Then, use a factory (like FixtureReplacement or Object Daddy) to
> generate the records in env.rb. Here's how you'd do that with
> FixtureReplacement (at the bottom of your env.rb file):
> include FixtureReplacement
> create_project(:slug => "my-unique-name-for-project1")
> create_project(:slug => "my-unique-name-for-the-second-project")
Yah - I actually did a similar thing for another model I found with
the same issue. This way I only have to add one column to the db. For
now, those are the only 2 projects we would need a slug for but, if we
needed more, we could add them later.
thanks for the logical conclusion to my issue :)
More information about the rspec-users