Cucumber (BDD framework): How can I make use_transactional_fixtures run only on @javascript scenarios?
-
So, some of my scenarios are tagged with @javascript so that they are run with selenium instead of rack_test. To make selenium tests work properly with the database, I had to disable transactional fixtures in my features/support/env.rb: Cucumber::Rails::World.use_transactional_fixtures = false DatabaseCleaner.strategy = :truncation Now, this works fine, but I want my test suite to be nice and speedy and NOT truncate the database more often than necessary (as it is an expensive operation). I.e. on scenarios not tagged with @javascript, I'd like to have use_transactional_fixtures = true. Where can I configure this?
-
Answer:
There has been some churn recently in cucumber-rails' support for database cleaning on @javascript scenarios. As of version 1.2.0 you can now choose whether to have @javascript scenarios use truncation or transactions for cleaning the database between scenarios. The rest of your suite can use a transaction-based cleaning strategy. See https://github.com/cucumber/cucumber-rails/blob/master/features/choose_javascript_database_strategy.feature for further details.
Matt Wynne at Quora Visit the source
Related Q & A:
- How Can I add Latitude, Longitude dynamically in Javascript?Best solution by Stack Overflow
- I have a blog how can I make money with it.Best solution by Yahoo! Answers
- How can I make clay use to make things?Best solution by Yahoo! Answers
- How can I make my room look amazing when I clean it?Best solution by Yahoo! Answers
- How do I make games run faster on my PC for free?Best solution by techradar.com
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.