diff --git a/spec/models/base_item_spec.rb b/spec/models/base_item_spec.rb index c4dcb7f505..ca96ec66ea 100644 --- a/spec/models/base_item_spec.rb +++ b/spec/models/base_item_spec.rb @@ -44,8 +44,8 @@ describe "->by_partner_key" do it "shows the Base Items by partner_key" do - base_item = create(:base_item) - expect(BaseItem.by_partner_key(base_item.partner_key).size).to eq(1) + base_item = create(:base_item, partner_key: "UniqueString") + expect(BaseItem.by_partner_key("UniqueString").size).to eq(1) expect(BaseItem.by_partner_key("random_string").size).to eq(0) end end diff --git a/spec/models/inventory_item_spec.rb b/spec/models/inventory_item_spec.rb index 43724887a8..e072787076 100644 --- a/spec/models/inventory_item_spec.rb +++ b/spec/models/inventory_item_spec.rb @@ -28,9 +28,10 @@ context "Filtering >" do describe "->by_partner_key" do - it "shows the Base Items by partner_key" do - item = create(:inventory_item) - expect(InventoryItem.by_partner_key(item.item.partner_key).size).to eq(1) + it "shows the Inventory Items by partner_key" do + create(:base_item, partner_key: "UniqueString") + create(:inventory_item, item: create(:item, partner_key: "UniqueString")) + expect(InventoryItem.by_partner_key("UniqueString").size).to eq(1) end end end