Spec that overridden price with fees appears in quick cart

This commit is contained in:
Rohan Mitchell
2014-12-18 13:32:28 +11:00
parent 5fcb2982fa
commit b0f5d0170c
2 changed files with 12 additions and 5 deletions

View File

@@ -12,7 +12,7 @@
%h5 Your shopping cart
%ul
%li.product-cart{"ng-repeat" => "line_item in Cart.line_items_present()",
"ng-controller" => "LineItemCtrl"}
"ng-controller" => "LineItemCtrl", "id" => "cart-variant-{{ line_item.variant.id }}"}
.row
.columns.small-7
%small
@@ -20,15 +20,15 @@
%em {{ line_item.variant.unit_to_display }}
.columns.small-3.text-right
%small
{{line_item.quantity}}
%span.quantity {{ line_item.quantity }}
%i.ofn-i_009-close
{{ line_item.variant.price_with_fees | localizeCurrency }}
%span.price {{ line_item.variant.price_with_fees | localizeCurrency }}
.columns.small-2
%small
\=
%strong
.right {{ line_item.variant.totalPrice() | localizeCurrency }}
.total-price.right {{ line_item.variant.totalPrice() | localizeCurrency }}
%li.total-cart{"ng-show" => "Cart.line_items_present().length > 0"}
.row

View File

@@ -54,7 +54,14 @@ feature "shopping with variant overrides defined", js: true do
page.should have_selector 'li.total div', text: '= $61.11'
end
it "shows the overridden price with fees in the quick cart"
it "shows the overridden price with fees in the quick cart" do
fill_in "variants[#{v1.id}]", with: "2"
show_cart
page.should have_selector "#cart-variant-#{v1.id} .quantity", text: '2'
page.should have_selector "#cart-variant-#{v1.id} .price", text: '61.11'
page.should have_selector "#cart-variant-#{v1.id} .total-price", text: '122.22'
end
it "shows the correct prices in the shopping cart"
it "shows the correct prices in the checkout"
it "creates the order with the correct prices"