     expect(facebookFriend.isShared()).toBe(true)
 
   it "should share message with default callback from window.facebookShareWidget", ->
-    spyOn($, "ajax").andCallFake (options)->
-      options.success()
     @success_callback = (friend) ->
     spyOn(this, 'success_callback')
 


    expect(@success_callback).toHaveBeenCalledWith(facebookFriend);

  it "should report error", ->
    spyOn($, "ajax").andCallFake (options)->
      options.error({responseText: '{"message":"111"}'})

    facebookFriend = new app.models.FacebookFriend
    facebookFriendView = new app.views.FacebookFriendView(model: facebookFriend, el: $('#sandbox'))
    facebookFriendView.render()

    $('.share-button').click()

    expect(facebookFriend.isShareFailed()).toBe(true)
    expect(facebookFriend.get('reason')).toBe("111")

  it "should share message with callback when error happening", ->
    spyOn($, "ajax").andCallFake (options)->
      options.error({responseText: '{"message":"111"}'})
    @error_callback = (friend) ->
    spyOn(this, 'error_callback')

    facebookFriend = new app.models.FacebookFriend fail_callback: @error_callback
    facebookFriendView = new app.views.FacebookFriendView(model: facebookFriend, el: $('#sandbox'))
    facebookFriendView.render()

    $('.share-button').click()

    expect(@error_callback).toHaveBeenCalledWith(facebookFriend);









    expect(@success_callback).toHaveBeenCalledWith(facebookFriend);

  it "should share message with callback", ->
    @success_callback = (friend) ->
    spyOn(this, 'success_callback')

