From a2b9c599f1b9fbc338ab95c1da5a28cfb293ea7b Mon Sep 17 00:00:00 2001 From: reeganviljoen Date: Tue, 19 Nov 2024 08:18:09 +0200 Subject: [PATCH] fis spcs --- test/sandbox/config/application.rb | 4 ++-- test/sandbox/test/rendering_test.rb | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/test/sandbox/config/application.rb b/test/sandbox/config/application.rb index 1565037d5..d9a514e47 100644 --- a/test/sandbox/config/application.rb +++ b/test/sandbox/config/application.rb @@ -7,8 +7,8 @@ require "action_controller/railtie" require "action_mailer/railtie" require "action_view/railtie" -require "sprockets/railtie" if Rails.version.to_f <= 7.2 || !ENV["BENCHMARK"].present? -# require "propshaft/railtie" if Rails.version.to_f >= 7.2 +require "sprockets/railtie" if Rails.version.to_f < 8.0 && !ENV["BENCHMARK"].present? +require "propshaft" if Rails.version.to_f >= 8.0 require "turbo-rails" diff --git a/test/sandbox/test/rendering_test.rb b/test/sandbox/test/rendering_test.rb index b8366e94b..86b9c2af4 100644 --- a/test/sandbox/test/rendering_test.rb +++ b/test/sandbox/test/rendering_test.rb @@ -336,10 +336,11 @@ def test_renders_component_without_format def test_renders_component_with_asset_url component = AssetComponent.new - if Rails.version.to_f <= 7.2 - assert_match(%r{http://assets.example.com/assets/application-\w+.css}, render_inline(component).text) + assert_match(%r{http://assets.example.com/assets/application-\w+.css}, render_inline(component).text) + + if Rails.version.to_f < 8.0 - # cant do this in Rails 8 https://github.com/rails/propshaft/pull/59 + # Propshaft doesnt allow setting custom hosts so this only works in Rails < 8 component.config.asset_host = nil assert_match(%r{/assets/application-\w+.css}, render_inline(component).text) @@ -348,8 +349,6 @@ def test_renders_component_with_asset_url component.config.asset_host = "assets.example.com" assert_match(%r{http://assets.example.com/assets/application-\w+.css}, render_inline(component).text) - else - assert_match(%r{http://assets.example.com/application.css}, render_inline(component).text) end end