There are various thoughts on if you should or should not use seeds for this.
I want to know if each discrete scenario works or does not work, with no interplay between them. This can make the suite take longer, but provides confidence in your testing that another scenario did not cause a chain reaction. Therefore, I choose to use seeds for this.
I have a support/seeds.rb
with contents:
Before do |scenario|
load Rails.root.join('db/seeds.rb')
end
Note, you might want to combine this with something like:
begin
# start off entire run with with a full truncation
# DatabaseCleaner.clean_with :truncation, {:except => %w[plans]}
DatabaseCleaner.clean_with :truncation
# continue with the :transaction strategy to be faster while running tests.
DatabaseCleaner.strategy = :transaction
rescue NameError
raise "You need to add database_cleaner to your Gemfile (in the :test group) if you wish to use it."
end