Skip to content

Commit ff11e8d

Browse files
forkatabenjaminwilKendra Rigaadammathys
committed
Make test assertion independent of config
We're proposing a new default for this configuration value, so this change updates the test in the new promotion system to not be dependent on the current default value. This test will fail if the default configuration changes. Co-authored-by: Benjamin Willems <benjamin@super.gd> Co-authored-by: Kendra Riga <kendra@super.gd> Co-authored-by: Adam Mueller <adam@super.gd>
1 parent c736cd8 commit ff11e8d

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

promotions/spec/lib/solidus_promotions/engine_spec.rb

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@
44

55
RSpec.describe SolidusPromotions::Engine do
66
describe "initializer.flickwerk_alias" do
7+
around do |example|
8+
original_value = Spree::Config.order_recalculator_class_name
9+
Spree::Config.order_recalculator_class = "ThisIsATestClassName"
10+
11+
example.run
12+
13+
Spree::Config.order_recalculator_class = original_value
14+
end
15+
716
it "sets the Flickwerk alias for order_recalculator_class" do
817
Flickwerk.aliases["Spree::Config.order_recalculator_class"] = nil
918

@@ -12,7 +21,7 @@
1221

1322
initializer = SolidusPromotions::Engine.initializers.find { |i| i.name == "solidus_promotions.flickwerk_alias" }
1423
initializer.run
15-
expect(Flickwerk.aliases["Spree::Config.order_recalculator_class"]).to eq("Spree::OrderUpdater")
24+
expect(Flickwerk.aliases["Spree::Config.order_recalculator_class"]).to eq("ThisIsATestClassName")
1625
end
1726
end
1827
end

0 commit comments

Comments
 (0)