Commit 14a9796c by Andy Armstrong

Re-enable the video translation Jasmine tests

TNL-2689
parent 9e5290c1
......@@ -28,7 +28,7 @@ require ["jquery", "backbone", "coffee/src/main", "common/js/spec_helpers/ajax_h
appendSetFixtures(sandbox({id: "page-notification"}))
it "successful AJAX request does not pop an error notification", ->
server = AjaxHelpers['server'](200, this)
server = AjaxHelpers.server(this, [200, {}, ''])
expect($("#page-notification")).toBeEmpty()
$.ajax("/test")
......@@ -37,7 +37,7 @@ require ["jquery", "backbone", "coffee/src/main", "common/js/spec_helpers/ajax_h
expect($("#page-notification")).toBeEmpty()
it "AJAX request with error should pop an error notification", ->
server = AjaxHelpers['server'](500, this)
server = AjaxHelpers.server(this, [500, {}, ''])
$.ajax("/test")
server.respond()
......@@ -45,7 +45,7 @@ require ["jquery", "backbone", "coffee/src/main", "common/js/spec_helpers/ajax_h
expect($("#page-notification")).toContain('div.wrapper-notification-error')
it "can override AJAX request with error so it does not pop an error notification", ->
server = AjaxHelpers['server'](500, this)
server = AjaxHelpers.server(this, [500, {}, ''])
$.ajax
url: "/test"
......
......@@ -34,7 +34,7 @@ define ["js/models/section", "common/js/spec_helpers/ajax_helpers", "js/utils/mo
})
it "show/hide a notification when it saves to the server", ->
server = AjaxHelpers['server'](200, this)
server = AjaxHelpers.server(this, [200, {}, ''])
@model.save()
expect(Section.prototype.showNotification).toHaveBeenCalled()
......@@ -43,7 +43,7 @@ define ["js/models/section", "common/js/spec_helpers/ajax_helpers", "js/utils/mo
it "don't hide notification when saving fails", ->
# this is handled by the global AJAX error handler
server = AjaxHelpers['server'](500, this)
server = AjaxHelpers.server(this, [500, {}, ''])
@model.save()
server.respond()
......
......@@ -18,12 +18,12 @@ define(['sinon', 'underscore'], function(sinon, _) {
* Get a reference to the mocked server, and respond
* to all requests with the specified statusCode.
*/
fakeServer = function (statusCode, that) {
fakeServer = function (that, response) {
var server = sinon.fakeServer.create();
that.after(function() {
server.restore();
});
server.respondWith([statusCode, {}, '']);
server.respondWith(response);
return server;
};
......
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