diff --git a/test/installer_test.rb b/test/installer_test.rb index 89c47306..df31d837 100644 --- a/test/installer_test.rb +++ b/test/installer_test.rb @@ -11,7 +11,9 @@ class InstallerTest < ActiveSupport::TestCase end run_command("bin/rails", "turbo:install") - assert_match %(import "@hotwired/turbo-rails"\n), File.read("app/javascript/application.js") + if Gem::Version.new(Rails.version) >= Gem::Version.new("7.0") + assert_match %(import "@hotwired/turbo-rails"\n), File.read("app/javascript/application.js") + end if Rails::VERSION::MAJOR >= 7 assert_match %(pin "@hotwired/turbo-rails", to: "turbo.min.js"), File.read("config/importmap.rb") @@ -39,6 +41,7 @@ class InstallerTest < ActiveSupport::TestCase run_command("bin/rails", "turbo:install") assert_match "// pre-existing", File.read("app/javascript/application.js") + assert_match %(import "@hotwired/turbo-rails"\n), File.read("app/javascript/application.js") end end