mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-02-26 01:33:22 +00:00
Adapt coordinator spec to ofn and remove spec that is not applicable (multi stock locations)
This commit is contained in:
@@ -5,7 +5,7 @@ require 'spec_helper'
|
||||
module Spree
|
||||
module Stock
|
||||
describe Coordinator do
|
||||
let!(:order) { create(:order_with_line_items) }
|
||||
let!(:order) { create(:order_with_line_items, distributor: create(:distributor_enterprise)) }
|
||||
|
||||
subject { Coordinator.new(order) }
|
||||
|
||||
@@ -17,20 +17,6 @@ module Spree
|
||||
subject.packages
|
||||
end
|
||||
end
|
||||
|
||||
context "build packages" do
|
||||
it "builds a package for every stock location" do
|
||||
subject.packages.count == StockLocation.count
|
||||
end
|
||||
|
||||
context "missing stock items in stock location" do
|
||||
let!(:another_location) { create(:stock_location, propagate_all_variants: false) }
|
||||
|
||||
it "builds packages only for valid stock locations" do
|
||||
subject.build_packages.count.should == (StockLocation.count - 1)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user