Fix ship_address_same_as_billing checkbox value with string

This commit is contained in:
Bing Xie
2016-08-18 15:29:16 +10:00
parent d59db1cd97
commit a6cfa061e4
6 changed files with 10 additions and 9 deletions

View File

@@ -62,7 +62,7 @@ describe "CheckoutCtrl", ->
console.log prefix
field = scope.fieldsToBind[0]
expect(storage.bind).toHaveBeenCalledWith(scope, "Checkout.order.#{field}", {storeName: "#{prefix}_#{field}"})
expect(storage.bind).toHaveBeenCalledWith(scope, "Checkout.ship_address_same_as_billing", {storeName: "#{prefix}_sameasbilling", defaultValue: true})
expect(storage.bind).toHaveBeenCalledWith(scope, "Checkout.ship_address_same_as_billing", {storeName: "#{prefix}_sameasbilling", defaultValue: 'YES'})
it "it can retrieve data from localstorage", ->
prefix = "order_#{scope.order.id}#{CurrentUser.id or ""}#{CurrentHubMock.hub.id}"

View File

@@ -126,9 +126,9 @@ describe 'Checkout service', ->
expect(Checkout.preprocess().ship_address).toBe(undefined)
it "munges the order attributes to clone ship address from bill address", ->
Checkout.ship_address_same_as_billing = false
Checkout.ship_address_same_as_billing = 'NO'
expect(Checkout.preprocess().ship_address_attributes).toEqual(orderData.ship_address)
Checkout.ship_address_same_as_billing = true
Checkout.ship_address_same_as_billing = 'YES'
expect(Checkout.preprocess().ship_address_attributes).toEqual(orderData.bill_address)
it "creates attributes for card fields", ->