Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- describe 'Task', ->
- #(...)
- describe "getters", ->
- describe "getId", ->
- it "should be defined", ->
- expect(@task.getId).toBeDefined()
- it "should return model's id", ->
- stub = sinon.stub(@task, 'get').returns 1
- expect(@task.getId()).toEqual 1
- expect(stub.calledWith('id')).toBeTruthy()
- describe "getName", ->
- it "should be defined", ->
- expect(@task.getName).toBeDefined()
- it "should return its name", ->
- spyOn(@task, 'get').andReturn 'Trololo!'
- expect(@task.getName()).toEqual 'Trololo!'
- expect(@task.get).toHaveBeenCalledWith('name')
- describe "isCompleted", ->
- it "should be defined", ->
- expect(@task.isCompleted).toBeDefined()
- it "should return value for the completed attribute", ->
- spyOn(@task, 'get').andReturn(false)
- expect(@task.isCompleted()).toEqual false
- expect(@task.get).toHaveBeenCalledWith('completed')
- describe "getEstimation", ->
- it "should be defined", ->
- expect(@task.getEstimation).toBeDefined()
- it "should return its estimation", ->
- spyOn(@task, 'get').andReturn 5
- expect(@task.getEstimation()).toEqual 5
- expect(@task.get).toHaveBeenCalledWith("estimation")
Add Comment
Please, Sign In to add comment