Stub base_price and fees on variant serializer. Calculate basePricePercentage on variant.

This commit is contained in:
Rohan Mitchell
2014-07-30 14:34:05 +10:00
parent 1ac5b79aeb
commit 77b279ca97
3 changed files with 17 additions and 1 deletions

View File

@@ -5,6 +5,8 @@ describe 'Variants service', ->
beforeEach ->
variant =
id: 1
base_price: 80
price: 100
module 'Darkswarm'
inject ($injector)->
Variants = $injector.get("Variants")
@@ -19,3 +21,5 @@ describe 'Variants service', ->
it "will return the same object as passed", ->
expect(Variants.register(variant)).toBe variant
it "initialises base price percentage", ->
expect(Variants.register(variant).basePricePercentage).toEqual 80