     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 share message with callback", ->
    spyOn($, "ajax").andCallFake (options)->
      options.success()
    @success_callback = (friend) ->
    spyOn(this, 'success_callback')



    expect(@success_callback).toHaveBeenCalledWith(facebookFriend);

  it "should call FB.ui function with redirect_uri and proper data", ->
    window.FB.ui = (data) ->
      expect(data.method).toEqual('feed')
      expect(data.to).toEqual(123)
      expect(data.redirect_uri).toEqual('http://localhost:8888/widget/facebook/share-redirect?facebook_id=123&link=test')

    facebookFriend = new app.models.FacebookFriend(id: 123)
    facebookFriendView = new app.views.FacebookFriendView(model: facebookFriend, el: $('#sandbox'))
    spyOn(facebookFriendView,'sharingTemplate').andCallFake ->
      '{"link":"test"}'
    facebookFriendView.render()

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



