Skip to content

Commit f6a1519

Browse files
author
Sefa Ilkimen
committed
add another cookie spec to validate silkimen#59
1 parent 419283c commit f6a1519

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

test/app-test-definitions.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -331,6 +331,25 @@ const tests = [
331331
.Cookie
332332
.should.be.equal('myCookie=myValue; mySecondCookie=mySecondValue');
333333
}
334+
},{
335+
description: 'should not send any cookies after running "clearCookies" (GET) #59',
336+
expected: 'resolved: {"status": 200, "data": "{\"headers\": {\"Cookie\": \"\"...',
337+
func: function(resolve, reject) {
338+
cordova.plugin.http.setCookie('http://httpbin.org/get', 'myCookie=myValue');
339+
cordova.plugin.http.setCookie('http://httpbin.org/get', 'mySecondCookie=mySecondValue');
340+
cordova.plugin.http.clearCookies();
341+
cordova.plugin.http.get('http://httpbin.org/get', {}, {}, resolve, reject);
342+
},
343+
validationFunc: function(driver, result) {
344+
result.type.should.be.equal('resolved');
345+
result.data.data.should.be.a('string');
346+
347+
JSON
348+
.parse(result.data.data)
349+
.headers
350+
.Cookie
351+
.should.be.equal('');
352+
}
334353
},{
335354
description: 'should send programmatically set cookies correctly (DOWNLOAD) #57',
336355
expected: 'resolved: {"content":{"cookies":{"myCookie":"myValue ...',

0 commit comments

Comments
 (0)