Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Using rake causes "except" to be ignored? #196

DaveSanders opened this Issue Mar 25, 2013 · 1 comment


None yet
1 participant

I am still trying to piece this together, but as I was trying to get my CI server up and running again, I ran into this weird issue. It boils down to this:

If I run my rspec with bundle exec rspec, database cleaner acts like it should, and respects my ":except=>" array as it should.

If I run my tests with "RAILS_ENV=test rake spec" then the tables are all getting truncated each and every time... no matter what's in my database cleaner config.

Is there something else I'm missing? Or maybe database cleaner isn't being invoked when running through rake? Anyone else running their tests this way?

Ignore this. I re-remembered now that rake spec will do the db:test:prepare stuff to ruin your pre-seeded database before running rspec. Sigh. I've neutered that now like so http://stackoverflow.com/questions/1158407/how-to-keep-data-when-run-test-in-rails, and now things are working.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment