Delete dead code: Order#item_count

This commit is contained in:
Matt-Yorkley
2021-03-06 00:04:46 +00:00
parent 1ad3f38942
commit f894473e03
2 changed files with 0 additions and 15 deletions

View File

@@ -220,11 +220,6 @@ module Spree
total.to_f > 0.0 && !skip_payment_for_subscription?
end
# Indicates the number of items in the order
def item_count
line_items.inject(0) { |sum, li| sum + li.quantity }
end
def backordered?
shipments.any?(&:backordered?)
end

View File

@@ -289,16 +289,6 @@ describe Spree::Order do
end
end
context "#item_count" do
before do
@order = create(:order, user: user)
@order.line_items = [create(:line_item, quantity: 2), create(:line_item, quantity: 1)]
end
it "should return the correct number of items" do
expect(@order.item_count).to eq 3
end
end
context "#amount" do
before do
@order = create(:order, user: user)