mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-01-24 20:36:49 +00:00
Fix stock location factory
This commit is contained in:
@@ -1,8 +1,5 @@
|
||||
FactoryBot.define do
|
||||
factory :stock_location, class: Spree::StockLocation do
|
||||
# Ensures the name attribute is not assigned after instantiating the default location
|
||||
transient { name 'default' }
|
||||
|
||||
# keeps the test stock_location unique
|
||||
initialize_with { DefaultStockLocation.find_or_create }
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@ describe DefaultStockLocation do
|
||||
|
||||
describe '.destroy_all' do
|
||||
it "removes all stock locations named 'default'" do
|
||||
create(:stock_location, name: 'default')
|
||||
create(:stock_location)
|
||||
|
||||
expect { described_class.destroy_all }
|
||||
.to change { Spree::StockLocation.count }.to(0)
|
||||
|
||||
Reference in New Issue
Block a user