assaf/zombie — Issue #214: jQuery AJAX requests to remote resources fail
Author: bergie
Created: 2011-12-01 11:41:45+00:00
State: open

This works, visiting `http://localhost:3000/somepage` with Zombie:

var promise = jQuery.ajax({
url: '/package.json',
dataType: 'json'
});
promise.done(function(data) {
equal(data.name, 'zombie-qunit');
});
promise.fail(function(err) {
equal(true, false, 'Request failed');
});

This doesn't, failing with message _Request failed: No Transport_:

var promise = jQuery.getJSON('http://schema.rdfs.org/all.json');
promise.done(function(data) {
ok(data, 'Check that we got data');
});
promise.fail(function(err) {
ok(false, 'Request failed: ' + err.statusText);
});

Here is the browser.dump:

zombie-qunit
Zombie: 0.11.7

URL: http://localhost:3000/qunit/index.html
History:
1: http://localhost:3000/qunit/index.html

Cookies:

Storage:
localhost:3000 session:
qunit-Module C: Asynchronous tests-Test AJAX call to external resource = 1

Eventloop:
The time: 1322739623482
Timers: 0
Processing: 0
Waiting: 0

Document:

✖ Examples of testing QUnit with Zombie

Running QUnit tests with Zombie