set up 3 stock locations, override sort_packages so that you have control over which one comes last. For brevity, they can be named "A", "B", and "C", and prioritized in that order.
set up the stock counts of a variant as such: A: 2, B: 4, C: 5
set up an order, and specify that a line item has 5 of the variant
Expected behavior
Tell us what should happen
there should be two shipments: 2 coming from A, and 3 coming from B
the prioritizer should be returning 2 inventory units in A, and 3 in B
Actual behavior
there are three shipments: 2 coming from A, 2 coming from B, and 1 coming from C
the prioritizer is returning 2 inventory units in A, 2 in B, and 1 in C
System configuration
Solidus Version:
2.0.0Extensions in use:
none, just common_spree_dependencies
I reproduced this by adding to the prioritizer_spec.rb in the solidus gem directory and running rspec in there (.rvm/gems/ruby-2.2.5/bundler/gems/solidus-blabla)
Steps to reproduce
sort_packages
so that you have control over which one comes last. For brevity, they can be named "A", "B", and "C", and prioritized in that order.Expected behavior
Tell us what should happen
Actual behavior
System configuration
Solidus Version:
2.0.0
Extensions in use: none, just common_spree_dependenciesI reproduced this by adding to the prioritizer_spec.rb in the solidus gem directory and running rspec in there (
.rvm/gems/ruby-2.2.5/bundler/gems/solidus-blabla
)here is a test that is expected to fail that can be added to https://github.com/solidusio/solidus/blob/master/core/spec/models/spree/stock/prioritizer_spec.rb#L86