mirror of
https://github.com/openfoodfoundation/openfoodnetwork
synced 2026-03-14 04:04:23 +00:00
Find variant overrides for some hubs
This commit is contained in:
@@ -1,6 +1,18 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe VariantOverride do
|
||||
describe "scopes" do
|
||||
let(:hub1) { create(:distributor_enterprise) }
|
||||
let(:hub2) { create(:distributor_enterprise) }
|
||||
let(:v) { create(:variant) }
|
||||
let!(:vo1) { create(:variant_override, hub: hub1, variant: v) }
|
||||
let!(:vo2) { create(:variant_override, hub: hub2, variant: v) }
|
||||
|
||||
it "finds variant overrides for a set of hubs" do
|
||||
VariantOverride.for_hubs([hub1, hub2]).sort.should == [vo1, vo2].sort
|
||||
end
|
||||
end
|
||||
|
||||
describe "looking up prices" do
|
||||
let(:variant) { create(:variant) }
|
||||
let(:hub) { create(:distributor_enterprise) }
|
||||
|
||||
Reference in New Issue
Block a user