Files
openfoodnetwork/spec/models/spree/stock/quantifier_spec.rb
2024-05-09 12:24:41 +10:00

25 lines
541 B
Ruby

# frozen_string_literal: true
require 'spec_helper'
module Spree
module Stock
RSpec.describe Quantifier do
let(:quantifier) { Spree::Stock::Quantifier.new(variant) }
let(:variant) { create(:variant, on_hand: 99) }
describe "#total_on_hand" do
context "with a soft-deleted variant" do
before do
variant.delete
end
it "returns zero stock for the variant" do
expect(quantifier.total_on_hand).to eq 0
end
end
end
end
end
end