spec/skr/models/SoLineSpec.coffee in stockor-0.1.9 vs spec/skr/models/SoLineSpec.coffee in stockor-0.2
- old
+ new
@@ -1,5 +1,10 @@
describe "Skr.Models.SoLine", ->
- it "can be instantiated", ->
+ it "can sets properties from the uom", ->
model = new Skr.Models.SoLine()
- expect(model).toEqual(jasmine.any(Skr.Models.SoLine))
+ spy = jasmine.createSpy('onuom')
+ model.on("change:uom", spy)
+ model.set(uom: new Skr.Models.Uom(size: 10, code: 'CS'))
+ expect(spy).toHaveBeenCalled()
+ expect(model.uom_size).toEqual(10)
+ expect(model.uom_code).toEqual('CS')