[rspec-users] Cucumber and fixtures/FixtureReplacement
aslak.hellesoy at gmail.com
Tue Sep 9 14:43:03 EDT 2008
On Tue, Sep 9, 2008 at 8:20 PM, Tim Glen <tim at pivotib.com> wrote:
>> On Tue, Sep 9, 2008 at 7:45 PM, Matt Wynne <matt at mattwynne.net> wrote:
>>> Remember these things should use transactions, and may do that by default
>>> the database will be wiped clean once the features have run.
> sorry - I wasn't trying to say that the database is empty after the
> scenarios are run, but that the specific fixtures or FixtureReplacements
> aren't in the db during the scenario. I'm basing that on doing
> Model.find(...) calls right in the steps file.
>> FWIW, When Cucumber is used with Rails it runs all scenarios in a
>> I haven't tried FixtureReplacement, but it should work just fine in
>> Given steps. I think you'd just have to make sure you mix in the
>> FixtureReplacement module in your "world". Put this in your
>> steps/env.rb and let us know how it works:
>> Before do
> I had previously tried this right in the steps file:
> Before do
Did you see that my code uses extend?
If that still doesn't work, file a bug report.
It might be a FixtureReplacement bug, but I'll still look into it.
> That resulted in an "undefined method `create_project'" exception. Trying
> what you suggest above (both in the env.rb file or the steps file) results
> in the same exception:
> Given that I am on the new project investment page
> undefined method `create_project' for
> #<ActionController::Integration::Session:0x43b0a5c> (NoMethodError)
> ./features/steps/cart_steps.rb:8:in `Given /I am on the new project
> investment page/'
> features/cart.feature:36:in `Given that I am on the new project
> investment page'
> Tim Glen
> tim at pivotib.com
> Rails v2.0.2
> RSpec v1.1.4
> rspec-users mailing list
> rspec-users at rubyforge.org
More information about the rspec-users