I’m not sure what’s going on, but I noticed that everytime I run my test with:
bundle exec rspec
the data in my development database disappears
I guess it has something to do with the DatabaseCleaner gem I installed, but I’m not sure what. I just copied the configuration lines from my previous Rails app and copied it into spec/spec_helper.rb:
config.order = "random" config.before(:suite) do DatabaseCleaner.clean_with(:truncation) end config.before(:each) do DatabaseCleaner.strategy = :transaction end config.before(:each, :js => true) do DatabaseCleaner.strategy = :truncation end config.before(:each) do DatabaseCleaner.start end config.after(:each) do DatabaseCleaner.clean end
Does someone know what’s going on?
my code is at:
thanks for your help,