Skip to content

Instantly share code, notes, and snippets.

@pschyska
Created October 19, 2012 12:49
Show Gist options
  • Save pschyska/3918085 to your computer and use it in GitHub Desktop.
Save pschyska/3918085 to your computer and use it in GitHub Desktop.
it "should be able to fetch a Shift", ->
@shifts.fetch
wait: true
shift = @shifts.get(window.shifts[0].id)
expect(shift instanceof Easypep.Models.Shift).toBeTruthy()
# Test if model serializes back to test data
expect(shift.toJSON()).toEqual(window.shifts[0])
it "should be able to fetch a Shift", ->
callback = sinon.spy =>
shift = @shifts.get(window.shifts[0].id)
expect(shift instanceof Easypep.Models.Shift).toBeTruthy()
# Test if model serializes back to test data
expect(shift.toJSON()).toEqual(window.shifts[0])
@shifts.fetch
success: callback
@server.repond()
expect(callback).toHaveBeenCalled()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment