Add method to clear cart

This commit is contained in:
Rohan Mitchell
2015-07-28 14:37:25 +10:00
parent 7caebb11e2
commit 012a210782
2 changed files with 8 additions and 0 deletions

View File

@@ -71,6 +71,11 @@ describe 'Cart service', ->
$timeout.flush()
expect(Cart.orderChanged).toHaveBeenCalled()
it "clears the cart", ->
expect(Cart.line_items).not.toEqual []
Cart.clear()
expect(Cart.line_items).toEqual []
describe "generating an extended variant name", ->
it "returns the product name when it is the same as the variant name", ->
variant = {product_name: 'product_name', name_to_display: 'product_name'}