File tree Expand file tree Collapse file tree 2 files changed +22
-1
lines changed
spec/lib/solidus_promotions Expand file tree Collapse file tree 2 files changed +22
-1
lines changed Original file line number Diff line number Diff line change 6
6
module SolidusPromotions
7
7
class Engine < Rails ::Engine
8
8
include SolidusSupport ::EngineExtensions
9
- Flickwerk . aliases [ "Spree::Config.order_recalculator_class" ] = Spree ::Config . order_recalculator_class_name
10
9
11
10
isolate_namespace ::SolidusPromotions
12
11
@@ -17,6 +16,10 @@ class Engine < Rails::Engine
17
16
g . test_framework :rspec
18
17
end
19
18
19
+ initializer "solidus_promotions.flickwerk_alias" do
20
+ Flickwerk . aliases [ "Spree::Config.order_recalculator_class" ] = Spree ::Config . order_recalculator_class_name
21
+ end
22
+
20
23
initializer "solidus_promotions.assets" do |app |
21
24
if SolidusSupport . backend_available?
22
25
app . config . assets . precompile << "solidus_promotions/manifest.js"
Original file line number Diff line number Diff line change
1
+ # frozen_string_literal: true
2
+
3
+ require "spec_helper"
4
+
5
+ RSpec . describe SolidusPromotions ::Engine do
6
+ describe "initializer.flickwerk_alias" do
7
+ it "sets the Flickwerk alias for order_recalculator_class" do
8
+ Flickwerk . aliases [ "Spree::Config.order_recalculator_class" ] = nil
9
+
10
+ require "solidus_promotions/engine"
11
+ expect ( Flickwerk . aliases [ "Spree::Config.order_recalculator_class" ] ) . to be_nil
12
+
13
+ initializer = SolidusPromotions ::Engine . initializers . find { |i | i . name == "solidus_promotions.flickwerk_alias" }
14
+ initializer . run
15
+ expect ( Flickwerk . aliases [ "Spree::Config.order_recalculator_class" ] ) . to eq ( "Spree::OrderUpdater" )
16
+ end
17
+ end
18
+ end
You can’t perform that action at this time.
0 commit comments