     expect(@success_callback).toHaveBeenCalledWith(facebookFriend);
 
   it "should share message with callback", ->
-    spyOn($, "ajax").andCallFake (options)->
-      options.success()
     @success_callback = (friend) ->
     spyOn(this, 'success_callback')
 

    window.HandlebarsTemplates = {}
    window.HandlebarsTemplates['facebook_share_widget/templates/friend'] = (f) ->
    setFixtures('<div id="sandbox"><div class="loader tick"><img src=""/></div></div>')


  it "should share message to friend", ->

    spyOn($, "ajax").andCallFake (options)->
      options.success()
    facebookFriend = new app.models.FacebookFriend
    facebookFriendView = new app.views.FacebookFriendView(model: facebookFriend, el: $('#sandbox'))
    facebookFriendView.render()

    expect(facebookFriend.isShared()).toBe(true)

  it "should share message with default callback from window.facebookShareWidget", ->
    @success_callback = (friend) ->
    spyOn(this, 'success_callback')

