Skip to content

Commit

Permalink
Use Order factory to create order in coupon specs
Browse files Browse the repository at this point in the history
The order is not valid without a store and this way the test
is more reliable, it reflects more closely what happens IRL.
  • Loading branch information
kennyadsl committed Jun 3, 2020
1 parent b4b89ba commit 1a9af09
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/spec/models/spree/promotion_handler/coupon_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 1a9af09

Please sign in to comment.