Skip to content

Commit

Permalink
Make sure the railtie is loaded before the app is initialized
Browse files Browse the repository at this point in the history
Otherwise the initializer code in the railtie will never execute.
  • Loading branch information
rafaelfranca committed Mar 20, 2024
1 parent 72e7bc8 commit d2e71f5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/better_html/railtie_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions test/dummy/config/application.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

Bundler.require(*Rails.groups)
require "better_html"
require "better_html/railtie"

module Dummy
class Application < Rails::Application
Expand Down

0 comments on commit d2e71f5

Please sign in to comment.