Reimplement checkout item removal. All existing tests now pass
This commit is contained in:
@@ -16,6 +16,10 @@ class ProductInCheckout
|
||||
@quantity += quantity
|
||||
end
|
||||
|
||||
def remove_quantity(quantity)
|
||||
@quantity = [@quantity - quantity, 0].max
|
||||
end
|
||||
|
||||
def total
|
||||
(@product.price * quantity) - @product.discount.discount_for_quantity(@quantity)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user