How to do proper database testing (TDD) on Rails 3 using MongoDB and Mongoid
问题 How would go about writing proper unit testing (and integration testing for that matter) using MongoDB through Mongoid on Rails ? I am asking, because to the opposite of using let's say SQLite3, even when running tests, everything I do does persists. So for the moment I am writing the creation test and then I manually delete everything I do. But it's getting annoying and even complicated to do for integration testing. Sample of what I do: before(:each) do @user = User.create!(@attr) end after