From 5edbdca5c0db00b0724bc0c9202c83194b688ae8 Mon Sep 17 00:00:00 2001 From: Fumiaki MATSUSHIMA Date: Wed, 1 Mar 2017 20:39:29 +0900 Subject: Fix random failure on system test with ajax If application has ajax, browser may begin request after rollback. `teardown_fixtures` will be called after `super` on `after_teardown` so we must call `Capybara.reset_sessions!` before `super` https://github.com/rails/rails/blob/b61a56541aecd7ac685d4f19d943177a3f1b465a/activerecord/lib/active_record/fixtures.rb#L857 --- .../action_dispatch/system_testing/test_helpers/setup_and_teardown.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'actionpack') diff --git a/actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb b/actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb index 1c89bfacfa..187ba2cc5f 100644 --- a/actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb +++ b/actionpack/lib/action_dispatch/system_testing/test_helpers/setup_and_teardown.rb @@ -11,8 +11,8 @@ module ActionDispatch def after_teardown take_failed_screenshot - super Capybara.reset_sessions! + super end end end -- cgit v1.2.3