mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Move test setup to application.rb
Without spree_core, the test environment file loads before the Spree engine is loaded
This commit is contained in:
@@ -23,6 +23,11 @@ module Openfoodnetwork
|
||||
end
|
||||
end
|
||||
|
||||
config.after_initialize do
|
||||
# We need this here because the test env file loads before the Spree engine is loaded
|
||||
Spree::Core::Engine.routes.default_url_options[:host] = 'test.host' if Rails.env = 'test'
|
||||
end
|
||||
|
||||
initializer "spree.environment", before: :load_config_initializers do |app|
|
||||
app.config.spree = Spree::Core::Environment.new
|
||||
Spree::Config = app.config.spree.preferences # legacy access
|
||||
|
||||
@@ -55,4 +55,3 @@ end
|
||||
|
||||
# Allows us to use _url helpers in Rspec
|
||||
Rails.application.routes.default_url_options[:host] = 'test.host'
|
||||
Spree::Core::Engine.routes.default_url_options[:host] = 'test.host'
|
||||
|
||||
Reference in New Issue
Block a user