Skip to content

Commit

Permalink
Only lazy load in test
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdebruin committed Dec 19, 2023
1 parent 960a80c commit fdada89
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions lib/route_translator/translator/route_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@ def add(old_name, named_route_collection)
__send__(Translator.route_name_for(args, old_name, suffix, self), *args)
end

TEST_CASE_HOOKS.each do |test_case_hook|
ActiveSupport.on_load(test_case_hook) do
include helper_container
if ENV.fetch('RAILS_ENV', nil) == 'test'
TEST_CASE_HOOKS.each do |test_case_hook|
ActiveSupport.on_load(test_case_hook) do
include helper_container
end
end
end
end
Expand Down

0 comments on commit fdada89

Please sign in to comment.