From a4f113ad484de1ede219e7130dada77ed9f9f7be Mon Sep 17 00:00:00 2001 From: cryptogopher Date: Fri, 12 Jan 2024 19:30:09 +0100 Subject: [PATCH] Downgrade importmap-rails to 1.2 v2.0.1 down not fire turbo:load event in test env, which causes tests to fail. Issue reported: https://github.com/rails/importmap-rails/issues/233 --- Gemfile | 2 +- Gemfile.lock | 4 ++-- test/system/units_test.rb | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Gemfile b/Gemfile index 7428ed1..cdb2024 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,7 @@ gem "devise" gem 'awesome_nested_set' -gem 'importmap-rails' +gem 'importmap-rails', '~> 1.2.3' # turborails >= 2.0.0 required with npm v8.0.0 with support for [autofocus] # attribute in turbo-streams gem 'turbo-rails', '> 1.5.0' diff --git a/Gemfile.lock b/Gemfile.lock index dd40034..6a1ae4c 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -112,7 +112,7 @@ GEM activesupport (>= 6.1) i18n (1.14.1) concurrent-ruby (~> 1.0) - importmap-rails (2.0.1) + importmap-rails (1.2.3) actionpack (>= 6.0.0) activesupport (>= 6.0.0) railties (>= 6.0.0) @@ -255,7 +255,7 @@ DEPENDENCIES byebug capybara devise - importmap-rails + importmap-rails (~> 1.2.3) mysql2 (~> 0.5) puma (~> 6.0) rails (~> 7.1.2) diff --git a/test/system/units_test.rb b/test/system/units_test.rb index 4364e16..99cc044 100644 --- a/test/system/units_test.rb +++ b/test/system/units_test.rb @@ -24,7 +24,7 @@ class UnitsTest < ApplicationSystemTestCase fill_in 'unit[name]', with: [nil, SecureRandom.alphanumeric(rand(1..maxlength['unit[name]']))].sample assert_difference ->{ Unit.count }, 1 do - click_on t(:add) + click_on t('helpers.submit.create') end end