Skip to content

Commit

Permalink
Use Capybara to disable animations in tests
Browse files Browse the repository at this point in the history
We were doing it manually, but Capybara offers an option which does the
exact same thing.

This way we also apply the NoJavascriptTagHelper ERB rule, which
reported one error in the `disable_animations_in_tests` partial.
  • Loading branch information
javierm committed Feb 5, 2021
1 parent 1c2886d commit b214205
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 9 deletions.
2 changes: 2 additions & 0 deletions .erb-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ linters:
enabled: true
FinalNewline:
enabled: true
NoJavascriptTagHelper:
enabled: true
SelfClosingTag:
enabled: false
SpaceAroundErbTag:
Expand Down
1 change: 0 additions & 1 deletion app/views/layouts/_common_head.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,3 @@
<%= javascript_include_tag "application", "data-turbolinks-track" => "reload" %>
<%= csrf_meta_tags %>
<%= favicon_link_tag "favicon.ico" %>
<%= render "layouts/disable_animations_in_tests" if Rails.env.test? %>
8 changes: 0 additions & 8 deletions app/views/layouts/_disable_animations_in_tests.html.erb

This file was deleted.

1 change: 1 addition & 0 deletions spec/rails_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,5 +47,6 @@

Capybara.exact = true
Capybara.enable_aria_label = true
Capybara.disable_animation = true

OmniAuth.config.test_mode = true

0 comments on commit b214205

Please sign in to comment.