I\'m using rspec for testing w my rails 3 app. I need to seed the database before the tests start. How can I seed the database with the following:
/db/seeds.rb>
However Scott's solution surely works for you, I believe the better way to solve your problem was to put the code responsible for seeding your test database within RSpec's configure block:
I use SeedFu and in my spec_helper I have:
RSpec.configure do |config|
# some other configuration code ...
config.before(:suite) do
# ...
SeedFu.seed
# ...
end
# some other configuration code ...
end