-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Using Mongoid::FixtureSet with RSpec #6
Comments
Have you tried |
@Aethelflaed I haven't. Just tried it and it gives me the following error:
|
Aha. It seems to work when I use this instead: require 'mongoid-fixture_set'
RSpec.configure do |config|
config.include Mongoid::FixtureSet::TestHelper
config.add_setting(:fixture_path, default: "#{Rails.root}/spec/fixtures")
end However, that still doesn't make the fixtures available. I either need to call config.before(:each) { setup_fixtures }
config.after(:each) { teardown_fixtures } |
After managing to get Mongoid::FixtureSet set up with RSpec as above, when running my tests, RSpec gets stuck for an extremely long time (30+ seconds) on the loading fixtures step, even though I've only defined a single, very minimal fixture file, usd:
label: US Dollar
code: USD
status: active
created_by: 2
updated_by: 2
euro:
label: Euro
code: EUR
status: active
created_by: 2
updated_by: 2 After the long wait, it eventually fails with the following error:
|
Turns setting This works: RSpec.configure do |config|
config.before(:all) do
self.class.fixture_path = "#{Rails.root}/spec/fixtures"
end
end |
glad you found a way to work around it, need any other help? |
I want to use this gem with RSpec, but can't quite figure out how. So far, I have this in my
spec_helper.rb
:I'm not really sure how to set the
fixture_path
, however.The text was updated successfully, but these errors were encountered: