Commit f7683833 by Jim Abramson

Merge pull request #3526 from edx/jsa/jasmine-fix

crude fix for intermittent jasmine test failures
parents d78dd92c 03977a46
......@@ -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)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment