diff --git a/test/test_app.rb b/test/test_app.rb index fe58010b..3206bffd 100644 --- a/test/test_app.rb +++ b/test/test_app.rb @@ -3,6 +3,9 @@ class TestApp < Rails::Application config.eager_load = false config.secret_key_base = 'abc123' end + config.after_initialize do + Rails.application.routes.default_url_options = { host: 'http://example.com' } + end # Set up a logger to avoid creating a log directory on every run. config.logger = Logger.new(nil) diff --git a/test/test_helper.rb b/test/test_helper.rb index b1bc95d0..d207b040 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -20,7 +20,5 @@ end ActionController::TestCase.class_eval do def setup @routes = TestHelper::Routes - - Rails.application.routes.default_url_options[:host] = 'http://example.com' if defined?(Rails) end end