[rspec-users] How to stop Rspec loading my Cucumber fixtures
steven_noble
steven at snoble.net
Wed Aug 10 17:53:37 EDT 2011
I have a bunch of fixtures designed to populate the database for my Cucumber
integration tests.
But at this stage I want my database to be empty when using Rspec.
So, I moved the fixtures from `/spec/fixtures` to
`features/support/fixtures`, and updated `features/support/env.rb` to read:
Fixtures.reset_cache
fixtures_folder = File.join(RAILS_ROOT, 'features', 'support',
'fixtures')
fixtures = Dir[File.join(fixtures_folder, '*.yml')].map {|f|
File.basename(f, '.yml') }
Fixtures.create_fixtures(fixtures_folder, fixtures)
So far so good. Cucumber still loads the fixtures I moved as planned.
But Rspec is still loading them too! This is despite `spec/spec_helper.rb`
saying:
config.fixture_path = "#{::Rails.root}/spec/fixtures"
I have tried setting the following in `spec/spec_helper.rb`:
config.use_transactional_fixtures = false
However, it doesn't work. And it wouldn't be a long-term solution anyway, as
I may need fixtures in Rspec in the future.
How can I fix this?
(Cross-posted from StackOverflow where there was no response.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20110810/8682749e/attachment.html>
More information about the rspec-users
mailing list