hey all, I''ve started playing around with object daddy and have a question? How do I ensure that anything created during a spec example gets rolled back before the next one? Without that ability, it starts messing with models that have unique columns on successive runs of my specs. Oh, and I do have this line in my spec_helper: config.use_transactional_fixtures = true I assume that only does anything to fixtures, specifically thanks, tim
Scott Taylor
2008-Sep-26 16:49 UTC
[rspec-users] RSpec, Rails, ObjectDaddy and transactions
On Sep 26, 2008, at 12:38 PM, Tim Glen wrote:> hey all, > > I''ve started playing around with object daddy and have a question? > How do I ensure that anything created during a spec example gets > rolled back before the next one? > > Without that ability, it starts messing with models that have unique > columns on successive runs of my specs. > > Oh, and I do have this line in my spec_helper: > config.use_transactional_fixtures = true > > I assume that only does anything to fixtures, specificallyNo. That tells rspec/ test::unit to start a transaction at the start of every test case, and issue a rollback when it''s over. That + a transactional database / storage engine should work out of the box. Scott
>> Oh, and I do have this line in my spec_helper: >> config.use_transactional_fixtures = true >> >> I assume that only does anything to fixtures, specifically > > No. That tells rspec/ test::unit to start a transaction at the > start of every test case, and issue a rollback when it''s over. > > That + a transactional database / storage engine should work out of > the box.aha! somehow the tables in my mysql db became MyISAM rather than InnoDB. Not sure how that happened since they''re all innodb on the production server. thanks for helping to keep me humble :) tim
Mark Wilden
2008-Sep-26 18:42 UTC
[rspec-users] RSpec, Rails, ObjectDaddy and transactions
On Fri, Sep 26, 2008 at 9:49 AM, Scott Taylor <mailing_lists at railsnewbie.com> wrote:> > On Sep 26, 2008, at 12:38 PM, Tim Glen wrote: > >> >> Oh, and I do have this line in my spec_helper: >> config.use_transactional_fixtures = true >> >> I assume that only does anything to fixtures, specifically >> > > No. That tells rspec/ test::unit to start a transaction at the start of > every test case, and issue a rollback when it''s over. >#use_transactional_fixtures seems misnamed. Ticket filed. ///ark -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20080926/f774edd9/attachment-0001.html>
David Chelimsky
2008-Sep-26 23:21 UTC
[rspec-users] RSpec, Rails, ObjectDaddy and transactions
On Fri, Sep 26, 2008 at 1:42 PM, Mark Wilden <mark at mwilden.com> wrote:> On Fri, Sep 26, 2008 at 9:49 AM, Scott Taylor > <mailing_lists at railsnewbie.com> wrote: >> >> On Sep 26, 2008, at 12:38 PM, Tim Glen wrote: >>> >>> Oh, and I do have this line in my spec_helper: >>> config.use_transactional_fixtures = true >>> >>> I assume that only does anything to fixtures, specifically >> >> No. That tells rspec/ test::unit to start a transaction at the start of >> every test case, and issue a rollback when it''s over. > > #use_transactional_fixtures seems misnamed. Ticket filed.I agree it''s the wrong name, but it''s the one Rails uses (RSpec just delegates over to Rails). David> ///ark > _______________________________________________ > rspec-users mailing list > rspec-users at rubyforge.org > http://rubyforge.org/mailman/listinfo/rspec-users >