From a15db65e69d2f5d46f8eddc7f4912e92ccf4a879 Mon Sep 17 00:00:00 2001 From: Matt-Yorkley <9029026+Matt-Yorkley@users.noreply.github.com> Date: Wed, 11 Sep 2019 04:32:19 +0100 Subject: [PATCH] Reload tested variant and price objects --- spec/models/spree/price_spec.rb | 2 +- spec/models/variant_override_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/spec/models/spree/price_spec.rb b/spec/models/spree/price_spec.rb index c44a361fb5..45af706c8d 100644 --- a/spec/models/spree/price_spec.rb +++ b/spec/models/spree/price_spec.rb @@ -28,7 +28,7 @@ module Spree end it "can access the variant" do - expect(price.variant).to eq variant + expect(price.reload.variant).to eq variant end end end diff --git a/spec/models/variant_override_spec.rb b/spec/models/variant_override_spec.rb index 98f10b5d7f..ecc2aff73e 100644 --- a/spec/models/variant_override_spec.rb +++ b/spec/models/variant_override_spec.rb @@ -138,11 +138,11 @@ describe VariantOverride do end it "soft-deletes the price" do - expect(price_object.deleted_at).to_not be_nil + expect(price_object.reload.deleted_at).to_not be_nil end it "can access the soft-deleted price" do - expect(variant_with_price.default_price).to eq price_object + expect(variant_with_price.reload.default_price).to eq price_object expect(variant_with_price.price).to eq 123.45 end end