From a3a52a07b7ddba482e584e7a572e95f47f811c0e Mon Sep 17 00:00:00 2001 From: Cillian O'Ruanaidh Date: Fri, 24 Jun 2022 16:35:22 +0100 Subject: [PATCH] Build shipping method with a category so it's valid in the test --- spec/models/spree/shipping_method_spec.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/spec/models/spree/shipping_method_spec.rb b/spec/models/spree/shipping_method_spec.rb index e806dc568f..fb8c2651e2 100644 --- a/spec/models/spree/shipping_method_spec.rb +++ b/spec/models/spree/shipping_method_spec.rb @@ -145,7 +145,10 @@ module Spree describe "#display_on" do it "is valid when it's set to nil, an empty string or 'back_end'" do - shipping_method = build_stubbed(:shipping_method) + shipping_method = build_stubbed( + :shipping_method, + shipping_categories: [Spree::ShippingCategory.new(name: 'Test')] + ) [nil, "", "back_end"].each do |display_on_option| shipping_method.display_on = display_on_option expect(shipping_method).to be_valid