Use .all convention for shipping and payment methods resource services

This commit is contained in:
Rob Harrington
2018-02-19 13:46:09 +11:00
committed by Rob H
parent 8951c79f71
commit 3ac57269ed
6 changed files with 16 additions and 16 deletions

View File

@@ -7,7 +7,7 @@ describe "EnterprisePaymentMethods service", ->
enterprise =
payment_method_ids: [ 1, 3 ]
PaymentMethods =
paymentMethods: [ { id: 1 }, { id: 2 }, { id: 3 }, { id: 4 } ]
all: [ { id: 1 }, { id: 2 }, { id: 3 }, { id: 4 } ]
module 'admin.enterprises'
module ($provide) ->
@@ -20,10 +20,10 @@ describe "EnterprisePaymentMethods service", ->
describe "selecting payment methods", ->
it "sets the selected property of each payment method", ->
expect(PaymentMethods.paymentMethods[0].selected).toBe true
expect(PaymentMethods.paymentMethods[1].selected).toBe false
expect(PaymentMethods.paymentMethods[2].selected).toBe true
expect(PaymentMethods.paymentMethods[3].selected).toBe false
expect(PaymentMethods.all[0].selected).toBe true
expect(PaymentMethods.all[1].selected).toBe false
expect(PaymentMethods.all[2].selected).toBe true
expect(PaymentMethods.all[3].selected).toBe false
describe "determining payment method colour", ->
it "returns 'blue' when at least one payment method is selected", ->

View File

@@ -7,7 +7,7 @@ describe "EnterpriseShippingMethods service", ->
enterprise =
shipping_method_ids: [ 1, 3 ]
ShippingMethods =
shippingMethods: [ { id: 1 }, { id: 2 }, { id: 3 }, { id: 4 } ]
all: [ { id: 1 }, { id: 2 }, { id: 3 }, { id: 4 } ]
module 'admin.enterprises'
module ($provide) ->
@@ -20,10 +20,10 @@ describe "EnterpriseShippingMethods service", ->
describe "selecting shipping methods", ->
it "sets the selected property of each shipping method", ->
expect(ShippingMethods.shippingMethods[0].selected).toBe true
expect(ShippingMethods.shippingMethods[1].selected).toBe false
expect(ShippingMethods.shippingMethods[2].selected).toBe true
expect(ShippingMethods.shippingMethods[3].selected).toBe false
expect(ShippingMethods.all[0].selected).toBe true
expect(ShippingMethods.all[1].selected).toBe false
expect(ShippingMethods.all[2].selected).toBe true
expect(ShippingMethods.all[3].selected).toBe false
describe "determining shipping method colour", ->
it "returns 'blue' when at least one shipping method is selected", ->