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:
Maikel Linke
2020-08-14 13:01:51 +10:00
parent c3e0f45f1a
commit 23706ec1d6
2 changed files with 20 additions and 0 deletions

View File

@@ -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

View 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