mirror of
https://github.com/silkimen/cordova-plugin-advanced-http.git
synced 2026-04-24 00:00:03 +08:00
test: fix broken tests due to changes at httpbingo.org
This commit is contained in:
+4
-4
@@ -321,18 +321,18 @@ const tests = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: 'should resolve correct URL after redirect (GET) #33',
|
description: 'should resolve correct URL after redirect (GET) #33',
|
||||||
expected: 'resolved: {"status": 200, url: "http://httpbin.org/anything", ...',
|
expected: 'resolved: {"status": 200, url: "http://httpbingo.org/anything", ...',
|
||||||
func: function (resolve, reject) { cordova.plugin.http.get('http://httpbingo.org/redirect-to?url=http://httpbin.org/anything', {}, {}, resolve, reject); },
|
func: function (resolve, reject) { cordova.plugin.http.get('http://httpbingo.org/redirect-to?url=http://httpbingo.org/anything', {}, {}, resolve, reject); },
|
||||||
validationFunc: function (driver, result) {
|
validationFunc: function (driver, result) {
|
||||||
result.type.should.be.equal('resolved');
|
result.type.should.be.equal('resolved');
|
||||||
result.data.url.should.be.equal('http://httpbin.org/anything');
|
result.data.url.should.be.equal('http://httpbingo.org/anything');
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
description: 'should not follow 302 redirect when following redirects is disabled',
|
description: 'should not follow 302 redirect when following redirects is disabled',
|
||||||
expected: 'rejected: {"status": 302, ...',
|
expected: 'rejected: {"status": 302, ...',
|
||||||
before: function (resolve, reject) { cordova.plugin.http.setFollowRedirect(false); resolve(); },
|
before: function (resolve, reject) { cordova.plugin.http.setFollowRedirect(false); resolve(); },
|
||||||
func: function (resolve, reject) { cordova.plugin.http.get('http://httpbingo.org/redirect-to?url=http://httpbin.org/anything', {}, {}, resolve, reject); },
|
func: function (resolve, reject) { cordova.plugin.http.get('http://httpbingo.org/redirect-to?url=http://httpbingo.org/anything', {}, {}, resolve, reject); },
|
||||||
validationFunc: function (driver, result) {
|
validationFunc: function (driver, result) {
|
||||||
result.type.should.be.equal('rejected');
|
result.type.should.be.equal('rejected');
|
||||||
result.data.status.should.be.equal(302);
|
result.data.status.should.be.equal(302);
|
||||||
|
|||||||
Reference in New Issue
Block a user