diff -r e1076102bd84 -r 5edd38e3205f web/test/jstests/test_ajax.js --- a/web/test/jstests/test_ajax.js Wed May 13 16:42:01 2015 +0200 +++ b/web/test/jstests/test_ajax.js Wed May 13 16:43:03 2015 +0200 @@ -11,7 +11,7 @@ cw.loaded_links = []; }, teardown: function() { - $('head script[src]:gt(' + this.scriptsLength + ')').remove(); + $('head script[src]:lt(' + ($('head script[src]').length - 1 - this.scriptsLength) + ')').remove(); $('head link[rel=stylesheet]:gt(' + this.cssLength + ')').remove(); } }); @@ -48,9 +48,9 @@ try { var origLength = scriptsIncluded.length; scriptsIncluded = jsSources(); - // check that foo.js has been *appended* to
+ // check that foo.js has been prepended to equals(scriptsIncluded.length, origLength + 1); - equals(scriptsIncluded[origLength].indexOf('http://foo.js'), 0); + equals(scriptsIncluded.indexOf('http://foo.js'), 0); // check that