 
   beforeEach ->
     sinon.stub(jQuery, 'ajax')
+    # Creating one student
+    @student = new studentModel
+      name: 'John New'
+      age: 17
+      sex: 'M'
 
   afterEach ->
     jQuery.ajax.restore()

    expect jQuery.ajax.getCall(0).args[0].data
    .toEqual JSON.stringify
      name: 'John New'
      age: 20
      sex: 'M'


    expect(attrs).toEqual {name: 'John New', age: 17, sex: null}

  it 'Should fetch a model', () ->
    # Setting student id for fetching
    @student.set 'id', 4
    @student.fetch
      success: sinon.spy()
    expect(jQuery.ajax.calledWithMatch { url: '/students/4' }).toBe true

  it 'Should save a model', ->
    # Saving student model
    @student.save
      success: sinon.spy()
    expect jQuery.ajax.calledWithMatch 
      url: '/students'
