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.
This commit is contained in:
Javier Martín
2018-06-23 19:41:17 +02:00
parent 24e4f027b1
commit 6245942196

View File

@@ -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? %>
</head>
<body class="admin" data-watch-form-message="<%= I18n.t('layouts.admin.watch_form_message') %>">