Consistently use our FeatureToggle module

Direct calls to Flipper have the downside that we can't add any new
functionality like storing the feature in the database when used.
This commit is contained in:
Maikel Linke
2022-10-06 09:33:58 +11:00
committed by Konrad
parent bc26a3aa07
commit 52e934ec2b
10 changed files with 33 additions and 21 deletions

View File

@@ -16,8 +16,10 @@ describe SplitCheckoutController, type: :controller do
let(:shipping_method) { distributor.shipping_methods.first }
before do
allow(Flipper).to receive(:enabled?).with(:split_checkout) { true }
allow(Flipper).to receive(:enabled?).with(:split_checkout, anything) { true }
allow(OpenFoodNetwork::FeatureToggle).
to receive(:enabled?).with(:split_checkout) { true }
allow(OpenFoodNetwork::FeatureToggle).
to receive(:enabled?).with(:split_checkout, anything) { true }
exchange.variants << order.line_items.first.variant
allow(controller).to receive(:current_order) { order }