diff --git a/spec/factories/tag_rule_factory.rb b/spec/factories/tag_rule_factory.rb index a902e98fbb..bcfa1783d8 100644 --- a/spec/factories/tag_rule_factory.rb +++ b/spec/factories/tag_rule_factory.rb @@ -4,7 +4,7 @@ FactoryBot.define do end factory :filter_shipping_methods_tag_rule, class: TagRule::FilterShippingMethods do - enterprise { FactoryBot.create :distributor_enterprise } + enterprise factory: :distributor_enterprise end factory :filter_products_tag_rule, class: TagRule::FilterProducts do diff --git a/spec/models/tag_rule/filter_shipping_methods_spec.rb b/spec/models/tag_rule/filter_shipping_methods_spec.rb index 58a1ee4854..6a52e4b679 100644 --- a/spec/models/tag_rule/filter_shipping_methods_spec.rb +++ b/spec/models/tag_rule/filter_shipping_methods_spec.rb @@ -1,7 +1,7 @@ require 'spec_helper' describe TagRule::FilterShippingMethods, type: :model do - let!(:tag_rule) { create(:filter_shipping_methods_tag_rule) } + let!(:tag_rule) { build_stubbed(:filter_shipping_methods_tag_rule) } describe "determining whether tags match for a given shipping method" do context "when the shipping method is nil" do @@ -11,7 +11,7 @@ describe TagRule::FilterShippingMethods, type: :model do end context "when the shipping method is not nil" do - let(:shipping_method) { create(:shipping_method, tag_list: ["member", "local", "volunteer"]) } + let(:shipping_method) { build_stubbed(:shipping_method, tag_list: ["member", "local", "volunteer"]) } context "when the rule has no preferred shipping method tags specified" do before { allow(tag_rule).to receive(:preferred_shipping_method_tags) { "" } }