From f56fa0b7a56e23ec92ee956d8e8464176a0c8f35 Mon Sep 17 00:00:00 2001 From: Luis Ramos Date: Sun, 23 Aug 2020 14:30:38 +0100 Subject: [PATCH] Bring calculator factories from spree_core --- spec/factories/calculator_factory.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/spec/factories/calculator_factory.rb b/spec/factories/calculator_factory.rb index 0c8acaf3e5..1268a8ccb7 100644 --- a/spec/factories/calculator_factory.rb +++ b/spec/factories/calculator_factory.rb @@ -1,4 +1,12 @@ FactoryBot.define do + factory :calculator, class: Spree::Calculator::FlatRate do + after(:create) { |c| c.set_preference(:amount, 10.0) } + end + + factory :no_amount_calculator, class: Spree::Calculator::FlatRate do + after(:create) { |c| c.set_preference(:amount, 0) } + end + sequence(:calculator_amount) factory :calculator_per_item, class: Calculator::PerItem do preferred_amount { generate(:calculator_amount) }