-
-
Notifications
You must be signed in to change notification settings - Fork 329
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot change database_cleaner strategy between scenario #180
Comments
Did you try to define your own hooks before the built-in ones are defined? # env.rb
Before('@javascript') do
DatabaseCleaner.strategy = :truncation
end
After('@javascript') do
DatabaseCleaner.strategy = DatabaseCleaner.default_strategy
end
# This defines the default hooks
require 'cucumber/rails'
... |
Thanks for the tip. It works. But since DatabaseCleaner.default_strategy doesn't exist (anymore?), I replaced it with :transaction. |
I'm reopening this just so I remember to put better instructions in the generated files. |
Obsolete by the fix of #166 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want to use transaction strategy for Rack Test and truncation strategy for Selenium test but cucumber rails make it impossible by adding a Before hook that call DatabaseCleaner.start. I want to change the strategy before DatabaseCleaner.start called, but cannot figure it out, since all hooks are appended. This make our test much slower.
The text was updated successfully, but these errors were encountered: