Skip to content

Commit 4dd059b

Browse files
committed
test: add e2e spec for redirect with protocol change #383
1 parent 89ac260 commit 4dd059b

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

test/e2e-specs.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,15 @@ const tests = [
316316
result.data.status.should.be.equal(302);
317317
}
318318
},
319+
{
320+
description: 'should follow 302 redirect with protocol change #383',
321+
expected: 'resolved: {"status": 200, url: "https://httpbin.org/anything", ...',
322+
func: function (resolve, reject) { cordova.plugin.http.get('http://httpbingo.org/redirect-to?url=https://httpbin.org/anything', {}, {}, resolve, reject); },
323+
validationFunc: function (driver, result) {
324+
result.type.should.be.equal('resolved');
325+
result.data.url.should.be.equal('https://httpbin.org/anything');
326+
}
327+
},
319328
{
320329
description: 'should download a file from given URL to given path in local filesystem',
321330
expected: 'resolved: {"content": "<?xml version=\'1.0\' encoding=\'us-ascii\'?>\\n\\n<!-- A SAMPLE set of slides -->" ...',

0 commit comments

Comments
 (0)