mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-02 21:57:17 +00:00
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:
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user