From f7d81998fc6cff530530ed43c64fb7fc77236999 Mon Sep 17 00:00:00 2001 From: Raul Ochoa Date: Tue, 9 Dec 2014 18:11:00 +0100 Subject: [PATCH] Fixes request test --- test/data/foobar.jsonp.js | 0 test/request.js | 16 ++++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) create mode 100644 test/data/foobar.jsonp.js diff --git a/test/data/foobar.jsonp.js b/test/data/foobar.jsonp.js new file mode 100644 index 0000000..e69de29 diff --git a/test/request.js b/test/request.js index a564f18..41f4576 100644 --- a/test/request.js +++ b/test/request.js @@ -4,7 +4,7 @@ QUnit.module('request'); asyncTest("json", 6, function(assert) { var called = null; - torque.net.jsonp('http://test.com?callback=?', function(test) { + torque.net.jsonp('./data/foobar.jsonp.js?callback=?', function(test) { called = arguments; }); @@ -13,19 +13,19 @@ asyncTest("json", 6, function(assert) { var found = null; for (var i = 0 ; !found && i < scripts.length; ++i) { var s = scripts[i]; - if (s.getAttribute('src').indexOf('test.com') !== -1) { + if (s.getAttribute('src').indexOf('foobar.jsonp.js') !== -1) { found = s; } } var src = found.getAttribute('src'); var fnName = src.match(/torque_.*/); window[fnName]('test1', 2, null); - equal(src.indexOf('http://test.com?callback=torque_'), 0); - equal(called[0], 'test1'); - equal(called[1], 2); - equal(called[2], null); - equal(found.parent, null); - equal(window[fnName], undefined); + assert.equal(src.indexOf('./data/foobar.jsonp.js?callback=torque_'), 0); + assert.equal(called[0], 'test1'); + assert.equal(called[1], 2); + assert.equal(called[2], null); + assert.equal(found.parent, null); + assert.equal(window[fnName], undefined); QUnit.start(); }, 5);