From cd8deca4bb959d9f0d8165a86c8505fee97ea0a5 Mon Sep 17 00:00:00 2001 From: Sarah Mei Date: Sat, 26 Feb 2011 06:16:34 -0800 Subject: [PATCH] fix jasmine specs --- spec/javascripts/contact-list-spec.js | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/spec/javascripts/contact-list-spec.js b/spec/javascripts/contact-list-spec.js index a49ac7636..afeb52a6d 100644 --- a/spec/javascripts/contact-list-spec.js +++ b/spec/javascripts/contact-list-spec.js @@ -7,15 +7,13 @@ describe("Contact List", function() { describe("disconnectUser", function() { it("does an ajax call to person delete with the passed in id", function(){ var id = '3'; - spyOn($,'ajax').andCallThrough(); + spyOn($,'ajax'); List.disconnectUser(id); - expect($.ajax).toHaveBeenCalledWith({ - url: "/contacts/" + id, - type: "DELETE", - success: function(){ - $('.contact_list li[data-guid='+id+']').fadeOut(200); - } - }); + expect($.ajax).toHaveBeenCalled(); + var option_hash = $.ajax.mostRecentCall.args[0]; + expect(option_hash.url).toEqual("/contacts/" + id); + expect(option_hash.type).toEqual("DELETE"); + expect(option_hash.success).toBeDefined(); }); }); });