Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
README, suggest append_after to ensure proper order of capybara clean…
…up and DC It's best to have DatabaseCleaner.clean run AFTER capybara cleanup, in case capybara cleanup ends up triggering anything that could be interrupted by the database cleaner. `require 'capybara/rspec'` installs an after hook for Capybara cleanup. rspec after hooks are run in _reverse_ order of definition, after hooks defined last are run first. So with `require 'capybara/rspec'` at top of file, and then later manually defining an after hook for DC cleanup... DC cleanup fires before capybara's cleanup. Using RSpec's `append_after` instead of `after` fixes this. With so many timing issues that can go wrong with capybara, might as well eliminate one more potential one.
- Loading branch information