You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Ensure database cleaner won't run until after Capybara has finished loading pages to stop false negative failures.
This can manifest itself if a page is still rendering when a Capybara test finishes without an expectation, e.g.:
Spec example has final line with an action to load a page, e.g. click_link "Next"without an expectation to check the action completed successfully.
While the page render triggered by step 1 is still in progress, database cleaner truncates tables that the page render is dependent on.
RSpec detects exceptions raised during page render and fails the test. These failures are hard to debug as they have no accompanying expectation.
To fix, ensure the database cleaner doesn't start until after Capybara has finished its work:
--- a/spec/support/database_cleaner.rb+++ b/spec/support/database_cleaner.rb@@ -55,7 +55,7 @@ RSpec.configure do |config|
DatabaseCleaner.start
end
- config.after(:each) do+ config.append_after(:each) do
DatabaseCleaner.clean
end
The text was updated successfully, but these errors were encountered:
Details: DatabaseCleaner/database_cleaner@a8bb2cb
Ensure database cleaner won't run until after Capybara has finished loading pages to stop false negative failures.
This can manifest itself if a page is still rendering when a Capybara test finishes without an expectation, e.g.:
click_link "Next"
without an expectation to check the action completed successfully.To fix, ensure the database cleaner doesn't start until after Capybara has finished its work:
The text was updated successfully, but these errors were encountered: