From d2e71f5a54cf998225c78fd8cb69cdaf73eb1ff4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafael=20Mendon=C3=A7a=20Fran=C3=A7a?= Date: Wed, 20 Mar 2024 18:13:06 +0000 Subject: [PATCH] Make sure the railtie is loaded before the app is initialized Otherwise the initializer code in the railtie will never execute. --- test/better_html/railtie_test.rb | 6 +++--- test/dummy/config/application.rb | 1 + 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/test/better_html/railtie_test.rb b/test/better_html/railtie_test.rb index a18fcc6..2d3a564 100644 --- a/test/better_html/railtie_test.rb +++ b/test/better_html/railtie_test.rb @@ -4,15 +4,15 @@ # setup dummy app ENV["RAILS_ENV"] ||= "test" require_relative "../dummy/config/environment" -# load railtie -require "better_html/railtie" + module BetterHtml class RailtieTest < ActiveSupport::TestCase if Rails::VERSION::STRING >= "6.1" test "configuration is copied from ActionView" do _ = ActionView::Base - assert BetterHtml.config.annotate_rendered_view_with_filenames + + assert_equal true, BetterHtml.config.annotate_rendered_view_with_filenames end end end diff --git a/test/dummy/config/application.rb b/test/dummy/config/application.rb index 03f7388..a536ec7 100644 --- a/test/dummy/config/application.rb +++ b/test/dummy/config/application.rb @@ -6,6 +6,7 @@ Bundler.require(*Rails.groups) require "better_html" +require "better_html/railtie" module Dummy class Application < Rails::Application