By default, before(:all) in rspec executes outside of any transaction, meaning that you can’t really use it for creating objects. Normally this should go in a before(:each), but for a spec with simple creation and a large number of assertions this is terribly inefficient. Let’s fix it! This code assumes you are using DataMapper, and that your database supports some form of nested transactions (at