Is there any configuration to do to enable DB rollbacks?

10 views
Skip to first unread message

Sharagoz

unread,
Jun 14, 2010, 4:26:54 PM6/14/10
to Machinist Users
I have just started to use machinist, and it looks awesome, but I
rollbacks are not happening for me. I use Rspec with mysql on win7
x64. I've looked around for info on this, but there's very little talk
about it, so I reckon it is enabled by default, however it does not
work on my box. Any ideas?

Pete Yandell

unread,
Jun 14, 2010, 8:43:28 PM6/14/10
to Machinist Users
Are you using it with ActiveRecord? Rails? What versions?

- Pete

Sharagoz

unread,
Jun 15, 2010, 2:46:33 AM6/15/10
to Machinist Users
Hi Pete

Yes, I am using both Rails and ActiveRecord, both are version 2.3.5

This is what blueprints.rb look like

require 'machinist/active_record'
require 'sham'
require 'faker'

Spec::Runner.configure do |config|
config.before(:all) { Sham.reset(:before_all) }
config.before(:each) { Sham.reset(:before_each) }
end

# Blueprints removed


Pete Yandell

unread,
Jun 15, 2010, 9:22:35 AM6/15/10
to machini...@googlegroups.com

On Tue, Jun 15, 2010 at 4:46 PM, Sharagoz <shar...@gmail.com> wrote:
Yes, I am using both Rails and ActiveRecord, both are version 2.3.5

ActiveRecord 2.3.5 uses transactional fixtures by default, so it should just work unless you've disabled them. 

That Spec::Runner.configure stuff should go inside the configure block in your spec_helper.rb. Not sure if doing it inside your blueprints file like that will work.

- Pete

Sharagoz

unread,
Jun 15, 2010, 3:40:35 PM6/15/10
to Machinist Users
On Jun 15, 3:22 pm, Pete Yandell <p...@notahat.com> wrote:
> it should just work unless you've disabled them.
I figured it out when you mentioned transactional fixures. I copied
spec_helper from another project where I have been experimenting with
selenium, and selenium requires that transactional fixtures are
disbled, so that was the problem. Thanks for your help!

> Not sure if doing it inside your blueprints file like that will work.
It does in the latest version of rspec/rspec-rails according to this
guy:
http://groups.google.com/group/machinist-users/browse_thread/thread/203365664278c8b2
Reply all
Reply to author
Forward
0 new messages