Angularising Order Cycles Index

This commit is contained in:
Rob Harrington
2016-06-24 10:37:19 +10:00
parent bf69ed0008
commit 2a5f598fb0
24 changed files with 437 additions and 182 deletions

View File

@@ -103,10 +103,11 @@ describe "OrderCycles service", ->
describe "diff", ->
beforeEach ->
OrderCycles.pristineByID = { 23: { id: 23, name: "ent1", is_primary_producer: true } }
OrderCycles.pristineByID = { 23: { id: 23, name: "orderCycle321", orders_open_at: '123' } }
it "returns a list of properties that have been altered", ->
expect(OrderCycles.diff({ id: 23, name: "orderCycle123", is_primary_producer: true })).toEqual ["name"]
it "returns a list of properties that have been altered, if they are in attrsToSave()", ->
spyOn(OrderCycles, "attrsToSave").and.returnValue(["orders_open_at"])
expect(OrderCycles.diff({ id: 23, name: "orderCycle123", orders_open_at: '321' })).toEqual ["orders_open_at"]
describe "resetAttribute", ->