# HG changeset patch # User Julien Cristau # Date 1448544887 -3600 # Node ID 25e2878a5ee227b08f5b1d84e196c251943c44ae # Parent 343a43503018be5d5f64b5d3ac7c423d50879015 [web/test] use GET, not POST, to load html files POST comes with a body. There isn't one. diff -r 343a43503018 -r 25e2878a5ee2 web/test/data/static/jstests/test_ajax.js --- a/web/test/data/static/jstests/test_ajax.js Tue Dec 01 09:09:48 2015 +0100 +++ b/web/test/data/static/jstests/test_ajax.js Thu Nov 26 14:34:47 2015 +0100 @@ -26,7 +26,7 @@ assert.expect(3); assert.equal($('#qunit-fixture').children().length, 0); var done = assert.async(); - $('#qunit-fixture').loadxhtml('static/jstests/ajax_url0.html') + $('#qunit-fixture').loadxhtml('static/jstests/ajax_url0.html', null, 'GET') .addCallback(function() { try { assert.equal($('#qunit-fixture').children().length, 1); @@ -43,7 +43,7 @@ var scriptsIncluded = jsSources(); assert.equal(jQuery.inArray('http://foo.js', scriptsIncluded), - 1); var done = assert.async(); - $('#qunit-fixture').loadxhtml('static/jstests/ajax_url1.html') + $('#qunit-fixture').loadxhtml('static/jstests/ajax_url1.html', null, 'GET') .addCallback(function() { try { var origLength = scriptsIncluded.length; @@ -66,7 +66,7 @@ assert.expect(3); assert.equal($('#qunit-fixture').children().length, 0); var done = assert.async(); - var d = $('#qunit-fixture').loadxhtml('static/jstests/ajax_url0.html'); + var d = $('#qunit-fixture').loadxhtml('static/jstests/ajax_url0.html', null, 'GET'); d.addCallback(function() { try { assert.equal($('#qunit-fixture').children().length, 1); @@ -105,7 +105,7 @@ assert.expect(3); assert.equal($('#qunit-fixture').children().length, 0); var done = assert.async(); - var d = $('#qunit-fixture').loadxhtml('static/jstests/ajax_url0.html'); + var d = $('#qunit-fixture').loadxhtml('static/jstests/ajax_url0.html', null, 'GET'); d.addCallback(function(data, req, arg1, arg2) { try { assert.equal(arg1, 'Hello'); @@ -155,7 +155,7 @@ QUnit.test('test addErrback', function (assert) { assert.expect(1); var done = assert.async(); - var d = $('#qunit-fixture').loadxhtml('static/jstests/nonexistent.html'); + var d = $('#qunit-fixture').loadxhtml('static/jstests/nonexistent.html', null, 'GET'); d.addCallback(function() { // should not be executed assert.ok(false, "callback is executed"); @@ -173,7 +173,7 @@ assert.expect(3); var counter = 0; var done = assert.async(); - var d = $('#qunit-fixture').loadxhtml('static/jstests/ajax_url0.html'); + var d = $('#qunit-fixture').loadxhtml('static/jstests/ajax_url0.html', null, 'GET'); d.addCallback(function() { assert.equal(++counter, 1); // should be executed first }); @@ -198,7 +198,7 @@ /* use endswith because in pytest context we have an absolute path */ assert.ok($('head link').attr('href').endswith('/qunit.css'), 'qunit.css is loaded'); var done = assert.async(); - $('#qunit-fixture').loadxhtml('static/jstests/ajax_url1.html') + $('#qunit-fixture').loadxhtml('static/jstests/ajax_url1.html', null, 'GET') .addCallback(function() { var origLength = scriptsIncluded.length; scriptsIncluded = jsSources(); @@ -235,7 +235,7 @@ // check that server-response event on CubicWeb is triggered events = 'CubicWeb'; }); - $('#qunit-fixture').loadxhtml('static/jstests/ajax_url0.html') + $('#qunit-fixture').loadxhtml('static/jstests/ajax_url0.html', null, 'GET') .addCallback(function() { try { assert.equal(events, 'CubicWeb'); @@ -256,7 +256,7 @@ $(CubicWeb).bind('server-response', function() { nodes.push('CubicWeb'); }); - $('#qunit-fixture').loadxhtml('static/jstests/ajax_url0.html') + $('#qunit-fixture').loadxhtml('static/jstests/ajax_url0.html', null, 'GET') .addCallback(function() { try { assert.equal(nodes.length, 2);