Skip to content

Commit

Permalink
fix jasmine specs
Browse files Browse the repository at this point in the history
  • Loading branch information
sarahmei authored and jhass committed Feb 26, 2011
1 parent b47714f commit 1adcc4c
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions spec/javascripts/contact-list-spec.js
Expand Up @@ -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();
});
});
});

0 comments on commit 1adcc4c

Please sign in to comment.