I put the following code in spec_helper.rb config.after(:each) do repository do |r| adapter = r.adapter while adapter.current_transaction adapter.current_transaction.rollback adapter.pop_transaction end end end
config.before(:each) do repository do |r| transaction = DataMapper::Transaction.new(r) transaction.begin r.adapter.push_transaction(transaction) end end it does what it's supposed to do and reset the database after every test. however it has a side affect. when i do. Model.count # is 0 @model.save # will save, but this save is wrapped in a transaction via dm-validations gem. Model.count # is still 0!!! it's really screwing with my test. SQL log looks something like this. begin count begin insert commit count .... for some strange reason, it doesn't pick up the change from the nested transaction with the second count. please help me over come this last hurdle. I've spent days converting my app over to datamapper, and I might have to go back to active record if I can't get the test suite to work. I supposed I could do away with transactional fixture and truncate my table before every test... -- You received this message because you are subscribed to the Google Groups "DataMapper" group. To post to this group, send email to datamap...@googlegroups.com. To unsubscribe from this group, send email to datamapper+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/datamapper?hl=.