From 03977a4666165ac378751e5b1965b5ed682a43be Mon Sep 17 00:00:00 2001 From: jsa Date: Tue, 29 Apr 2014 14:26:12 -0400 Subject: [PATCH] crude fix for intermittent jasmine test failures --- .../spec/discussion/view/response_comment_view_spec.coffee | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/common/static/coffee/spec/discussion/view/response_comment_view_spec.coffee b/common/static/coffee/spec/discussion/view/response_comment_view_spec.coffee index 05bfe7ee40..4ce062e9b9 100644 --- a/common/static/coffee/spec/discussion/view/response_comment_view_spec.coffee +++ b/common/static/coffee/spec/discussion/view/response_comment_view_spec.coffee @@ -141,8 +141,6 @@ describe 'ResponseCommentView', -> spyOn(@view, 'cancelEdit') spyOn($, "ajax").andCallFake( (params) => - expect(params.url._parts.path).toEqual("/courses/edX/999/test/discussion/comments/01234567/update") - expect(params.data.body).toEqual(@updatedBody) if @ajaxSucceed params.success() else @@ -154,6 +152,8 @@ describe 'ResponseCommentView', -> @ajaxSucceed = true @view.update(makeEventSpy()) expect($.ajax).toHaveBeenCalled() + expect($.ajax.mostRecentCall.args[0].url._parts.path).toEqual('/courses/edX/999/test/discussion/comments/01234567/update') + expect($.ajax.mostRecentCall.args[0].data.body).toEqual(@updatedBody) expect(@view.model.get("body")).toEqual(@updatedBody) expect(@view.cancelEdit).toHaveBeenCalled() @@ -162,6 +162,8 @@ describe 'ResponseCommentView', -> @ajaxSucceed = false @view.update(makeEventSpy()) expect($.ajax).toHaveBeenCalled() + expect($.ajax.mostRecentCall.args[0].url._parts.path).toEqual('/courses/edX/999/test/discussion/comments/01234567/update') + expect($.ajax.mostRecentCall.args[0].data.body).toEqual(@updatedBody) expect(@view.model.get("body")).toEqual(originalBody) expect(@view.cancelEdit).not.toHaveBeenCalled() expect(@view.$(".edit-comment-form-errors *").length).toEqual(1)