[rspec-users] rspec (steak) turning off transactional fixtures

Marcelo de Moraes Serpa celoserpa at gmail.com
Tue Jun 15 18:15:54 EDT 2010


Hey all,

I have replaced Cucumber with Steak and I like the experience so far. It is
not as polished as Cucumber in what comes to configuration, but it is
simpler and covers my needs perfectly. I've followed the trick to pass a
hash to the example in order to setup Capybara to use a different driver,
like so:

spec/acceptance/support/javascript.rb

Spec::Runner.configure do |config|

  config.before(:each) do
    if options[:js] #using culerity
      Capybara.current_driver = :culerity
      config.use_transactional_fixtures = false
    end
  end

  config.after(:each) do
    if  options[:js]
      DatabaseCleaner.clean
      Capybara.use_default_driver
      config.use_transactional_fixtures = true
    end
  end

end

As you can see, if an example has an option with :js => true, it will use
culerity, and this works fine. What doesn't seem to work is the
use_transactional_fixtures = false conf. I still can't access the data
outside of the ruby instance (i.e: the app server celerity is accessing
doesn't have access to the fixture data). With Cucumber it would be a matter
of setting up *Cucumber*::Rails::*World*.use_transactional_fixtures to
false.

How could I disable transactional fixtures on a per example base when using
rspec / steak?

Thanks,

Marcelo.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20100615/8c6e8a82/attachment.html>


More information about the rspec-users mailing list