Fix shipping_method basic test. Adapt to spree 2 that needs shipping_categories to be set and sets them on the base factory in a after_create block, the build command was not picking it up

This commit is contained in:
luisramos0
2018-10-27 20:34:25 +01:00
parent 4450380cb0
commit b16ed86b2d
2 changed files with 2 additions and 2 deletions

View File

@@ -565,7 +565,7 @@ FactoryBot.modify do
end
end
factory :shipping_method do
factory :shipping_method, parent: :base_shipping_method do
distributors { [Enterprise.is_distributor.first || FactoryBot.create(:distributor_enterprise)] }
display_on ''
end

View File

@@ -3,7 +3,7 @@ require 'spec_helper'
module Spree
describe ShippingMethod do
it "is valid when built from factory" do
build(:shipping_method).should be_valid
create(:shipping_method).should be_valid
end
it "can have distributors" do