mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-27 01:43:22 +00:00
Merge pull request #8632 from Matt-Yorkley/default-url-options
Set default_url_options in all environments
This commit is contained in:
@@ -5,3 +5,5 @@ SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
|
||||
OFN_REDIS_URL="redis://localhost:6379/1"
|
||||
OFN_REDIS_JOBS_URL="redis://localhost:6379/2"
|
||||
|
||||
SITE_URL="0.0.0.0:3000"
|
||||
|
||||
@@ -2,3 +2,5 @@
|
||||
# Override locally with `.env.test.local`
|
||||
|
||||
SECRET_TOKEN="xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
|
||||
|
||||
SITE_URL="test.host"
|
||||
|
||||
@@ -45,7 +45,7 @@ module Openfoodnetwork
|
||||
|
||||
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'
|
||||
Spree::Core::Engine.routes.default_url_options[:host] = ENV["SITE_URL"] if Rails.env == 'test'
|
||||
end
|
||||
|
||||
# We reload the routes here
|
||||
@@ -230,6 +230,8 @@ module Openfoodnetwork
|
||||
|
||||
config.generators.template_engine = :haml
|
||||
|
||||
Rails.application.routes.default_url_options[:host] = ENV["SITE_URL"]
|
||||
|
||||
config.autoloader = :zeitwerk
|
||||
|
||||
config.action_view.form_with_generates_ids = true
|
||||
|
||||
@@ -52,6 +52,3 @@ Openfoodnetwork::Application.configure do
|
||||
|
||||
config.active_job.queue_adapter = :test
|
||||
end
|
||||
|
||||
# Allows us to use _url helpers in Rspec
|
||||
Rails.application.routes.default_url_options[:host] = 'test.host'
|
||||
|
||||
@@ -46,7 +46,7 @@ Capybara.configure do |config|
|
||||
end
|
||||
|
||||
# Override setting in Spree engine: Spree::Core::MailSettings
|
||||
ActionMailer::Base.default_url_options[:host] = 'test.host'
|
||||
ActionMailer::Base.default_url_options[:host] = ENV["SITE_URL"]
|
||||
|
||||
FactoryBot.use_parent_strategy = false
|
||||
|
||||
|
||||
Reference in New Issue
Block a user