From 1a9af0916d6a3662eaf2e92f43397590d3973531 Mon Sep 17 00:00:00 2001 From: Alberto Vena Date: Fri, 29 May 2020 17:17:54 +0200 Subject: [PATCH] Use Order factory to create order in coupon specs The order is not valid without a store and this way the test is more reliable, it reflects more closely what happens IRL. --- core/spec/models/spree/promotion_handler/coupon_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/spec/models/spree/promotion_handler/coupon_spec.rb b/core/spec/models/spree/promotion_handler/coupon_spec.rb index 9624e484f48..4cdef736fd5 100644 --- a/core/spec/models/spree/promotion_handler/coupon_spec.rb +++ b/core/spec/models/spree/promotion_handler/coupon_spec.rb @@ -169,7 +169,7 @@ def expect_adjustment_creation(adjustable:, promotion:, promotion_code: nil) end context "applied alongside another valid promotion " do - let!(:order) { Order.create } + let!(:order) { create(:order) } before do order.coupon_code = "10off"