Skip to content

Commit

Permalink
Fix installer test for Rails 6.1
Browse files Browse the repository at this point in the history
  • Loading branch information
zzak committed Nov 4, 2024
1 parent 52e8109 commit c41707e
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion test/installer_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down Expand Up @@ -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

Expand Down

0 comments on commit c41707e

Please sign in to comment.