From 6415b7fb64d287ccb2ef461d65b0c0fb8fbafd2f Mon Sep 17 00:00:00 2001 From: Martin Meyerhoff Date: Wed, 22 May 2024 11:24:01 +0200 Subject: [PATCH] Increase spec coverage for Spree::SimpleOrderContents There were two uncovered lines, and this adds coverage for those lines. --- .../models/spree/simple_order_contents_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/core/spec/models/spree/simple_order_contents_spec.rb b/core/spec/models/spree/simple_order_contents_spec.rb index 812b5fa2b8a..e9f5af69d06 100644 --- a/core/spec/models/spree/simple_order_contents_spec.rb +++ b/core/spec/models/spree/simple_order_contents_spec.rb @@ -266,6 +266,16 @@ expect(subject.order).to receive(:check_shipments_and_restart_checkout) subject.update_cart params end + + context "with invalid params" do + let(:params) do + { number: "" } + end + + it "returns false" do + expect(subject.update_cart(params)).to be false + end + end end context "completed order" do @@ -333,4 +343,11 @@ end end end + + describe "#advance" do + it "advances the order" do + expect(order).to receive(:next).at_least(:once) + subject.advance + end + end end