From c55d04586e9999f6cd02fb700bc61eb75bcfe5dc Mon Sep 17 00:00:00 2001 From: Chris de Bruin Date: Tue, 19 Dec 2023 13:49:44 +0100 Subject: [PATCH] Only lazy load in test --- lib/route_translator/translator/route_helpers.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/route_translator/translator/route_helpers.rb b/lib/route_translator/translator/route_helpers.rb index b8935173..9a885698 100644 --- a/lib/route_translator/translator/route_helpers.rb +++ b/lib/route_translator/translator/route_helpers.rb @@ -27,6 +27,8 @@ def add(old_name, named_route_collection) __send__(Translator.route_name_for(args, old_name, suffix, self), *args) end + next unless ENV.fetch('RAILS_ENV', nil) == 'test' + TEST_CASE_HOOKS.each do |test_case_hook| ActiveSupport.on_load(test_case_hook) do include helper_container