@@ -297,25 +297,25 @@ const tests = [
297297 JSON . parse ( result . data . data ) . form . should . eql ( { test : 'testString' } ) ;
298298 }
299299 } ,
300- // {
301- // description: 'should resolve correct URL after redirect (GET) #33',
302- // expected: 'resolved: {"status": 200, url: "http://httpbin.org/anything", ...',
303- // func: function (resolve, reject) { cordova.plugin.http.get('http://httpbin .org/redirect-to?url=http://httpbin.org/anything', {}, {}, resolve, reject); },
304- // validationFunc: function (driver, result) {
305- // result.type.should.be.equal('resolved');
306- // result.data.url.should.be.equal('http://httpbin.org/anything');
307- // }
308- // },
309- // {
310- // description: 'should not follow 302 redirect when following redirects is disabled',
311- // expected: 'rejected: {"status": 302, ...',
312- // before: function (resolve, reject) { cordova.plugin.http.disableRedirect(true, resolve, reject) },
313- // func: function (resolve, reject) { cordova.plugin.http.get('http://httpbin .org/redirect-to?url=http://httpbin.org/anything', {}, {}, resolve, reject); },
314- // validationFunc: function (driver, result) {
315- // result.type.should.be.equal('rejected');
316- // result.data.status.should.be.equal(302);
317- // }
318- // },
300+ {
301+ description : 'should resolve correct URL after redirect (GET) #33' ,
302+ expected : 'resolved: {"status": 200, url: "http://httpbin.org/anything", ...' ,
303+ func : function ( resolve , reject ) { cordova . plugin . http . get ( 'http://httpbingo .org/redirect-to?url=http://httpbin.org/anything' , { } , { } , resolve , reject ) ; } ,
304+ validationFunc : function ( driver , result ) {
305+ result . type . should . be . equal ( 'resolved' ) ;
306+ result . data . url . should . be . equal ( 'http://httpbin.org/anything' ) ;
307+ }
308+ } ,
309+ {
310+ description : 'should not follow 302 redirect when following redirects is disabled' ,
311+ expected : 'rejected: {"status": 302, ...' ,
312+ before : function ( resolve , reject ) { cordova . plugin . http . setFollowRedirect ( false ) ; resolve ( ) ; } ,
313+ func : function ( resolve , reject ) { cordova . plugin . http . get ( 'http://httpbingo .org/redirect-to?url=http://httpbin.org/anything' , { } , { } , resolve , reject ) ; } ,
314+ validationFunc : function ( driver , result ) {
315+ result . type . should . be . equal ( 'rejected' ) ;
316+ result . data . status . should . be . equal ( 302 ) ;
317+ }
318+ } ,
319319 {
320320 description : 'should download a file from given URL to given path in local filesystem' ,
321321 expected : 'resolved: {"content": "<?xml version=\'1.0\' encoding=\'us-ascii\'?>\\n\\n<!-- A SAMPLE set of slides -->" ...' ,
0 commit comments