From 1875cab64a0cb62eb9d144c387ce1b18c1ab2afc Mon Sep 17 00:00:00 2001 From: Andrey Krivko Date: Mon, 29 Sep 2014 18:07:56 +0700 Subject: [PATCH] Fix path where test-app is getting configured --- test/test_app.rb | 3 +++ test/test_helper.rb | 2 -- 2 files changed, 3 insertions(+), 2 deletions(-) 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