I'm using Turnip and Ruby on Rails. I have scenarios with and without using javascript. I want to use the transaction
DatabaseCleaner strategy for the non-javascript scenarios and the truncation
strategy for scenarios marked by @javascript
, @selenium
and etc.
I'm using following solution for Rspec Features
config.around(:each, :js => true) do |ex|
DatabaseCleaner.strategy = :truncation
ex.run
DatabaseCleaner.strategy = :transaction
end
But it doesn't work in Turnip case. What is the best way to make it works as I expected? Or in other words how to specify turnip scenario marked by @javascript
(or @selenium
and etc) tag in config.before
?