0
我有很多的测试,如下列:如何干涸这些试验与jasmine.js
it "Should call togglePadding if df-padding is checked", ->
spyOn(App.columnsSetupBuildingBlockController.content, 'togglePadding')
App.view.set("paddingChecked", null)
Em.run ->
App.view.set("paddingChecked", true)
expect(App.columnsSetupBuildingBlockController.content.togglePadding).toHaveBeenCalledWith(true)
it "Should call togglePadding if df-padding is unchecked", ->
spyOn(App.columnsSetupBuildingBlockController.content, 'togglePadding')
App.view.set("paddingChecked", true)
Em.run ->
App.view.set("paddingChecked", null)
expect(App.columnsSetupBuildingBlockController.content.togglePadding).toHaveBeenCalledWith(null)
只有在每个测试是不同饥荒预警系统不同的值。我怎么写一个共享函数来干燥重复的位,并使它看起来更清洁?
我也有相同的测试边缘测试,边界等
请帮助。
感谢 里克