Hi,
I've got a Rails app and I'd like to introduce the nulldb adapter to ensure
the type:model tests do not hit the database. I do want an exception for
when I test scopes or other complex queries. Is there anyway to have two
conflicting configuration before blocks, something like:
describe MyModel do
it 'tests scopes', db: true
...
end
it 'tests something else' do
...
end
end
config.before(type: :model, db: true) do
# use real database
end
config.before(type: :model, unless: db) do
# use nulldb
end
cheers
Robbie
--
You received this message because you are subscribed to the Google Groups
"rspec" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
To view this discussion on the web visit
https://groups.google.com/d/msg/rspec/-/OeGzD5qOMHMJ.
For more options, visit https://groups.google.com/groups/opt_out.