From 6245942196a7055ae096f2c78df88d87bb1ccfec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Javier=20Mart=C3=ADn?= Date: Sat, 23 Jun 2018 19:41:17 +0200 Subject: [PATCH] Don't use jQuery animations in tests. There's a flaky test creating a group for a budget which takes place because toggling a form using jQuery sometimes results in the button not being correctly clicked by Capybara. Checking the page with `expect(page).to have_button 'Create group'` before clicking the button doesn't solve the problem; it looks like in those cases Capybara waits for AJAX requests but not for JavaScript animations. See also issue #2573. --- app/views/layouts/admin.html.erb | 1 + 1 file changed, 1 insertion(+) diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index 351c04b76..df64a250f 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -11,6 +11,7 @@ <%= content_for :head %> <%= csrf_meta_tags %> <%= favicon_link_tag "favicon.ico" %> + <%= javascript_tag "jQuery.fx.off = true" if Rails.env.test? %>