mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Load our version of the Spree environment
We didn't actually change any logic in our version of the Spree environment file but if we do that in the future, we want to be sure that it takes effect. Our file was ignored and not loaded before.
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
# In order to initialize a setting do:
|
||||
# config.setting_name = 'new value'
|
||||
|
||||
require "spree/core/environment"
|
||||
require 'spree/product_filters'
|
||||
|
||||
# Due to a bug in ActiveRecord we need to load the tagging code in Gateway which
|
||||
|
||||
19
spec/lib/spree/core/environment_spec.rb
Normal file
19
spec/lib/spree/core/environment_spec.rb
Normal file
@@ -0,0 +1,19 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'spec_helper'
|
||||
|
||||
describe Spree::Core::Environment do
|
||||
# Our version doesn't add any features we could test.
|
||||
# So we just check that our file is loaded correctly.
|
||||
let(:our_file) { Rails.root.join("lib/spree/core/environment.rb").to_s }
|
||||
|
||||
it "is defined in our code" do
|
||||
file = subject.method(:initialize).source_location.first
|
||||
expect(file).to eq our_file
|
||||
end
|
||||
|
||||
it "used by Spree" do
|
||||
file = Spree::Core::Engine.config.spree.method(:initialize).source_location.first
|
||||
expect(file).to eq our_file
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user