1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Add test case that configure config.action_view.finalize_compiled_template_methods

Follow up of #32418.
This commit is contained in:
yuuji.yaginuma 2018-05-20 10:19:12 +09:00
parent 5f8115a185
commit ce4d467f7c

View file

@ -1979,6 +1979,23 @@ module ApplicationTests
assert_equal true, ActionView::Helpers::FormTagHelper.default_enforce_utf8
end
test "ActionView::Template.finalize_compiled_template_methods is true by default" do
app "test"
assert_equal true, ActionView::Template.finalize_compiled_template_methods
end
test "ActionView::Template.finalize_compiled_template_methods can be configured via config.action_view.finalize_compiled_template_methods" do
app_file "config/environments/test.rb", <<-RUBY
Rails.application.configure do
config.action_view.finalize_compiled_template_methods = false
end
RUBY
app "test"
assert_equal false, ActionView::Template.finalize_compiled_template_methods
end
private
def force_lazy_load_hooks
yield # Tasty clarifying sugar, homie! We only need to reference a constant to load it.