Skip to content

Commit e4cdea1

Browse files
committed
Merge pull request #149 from FagnerMartinsBrack/tests-cookie-write
write cookies using $.cookie since the read operation already tests it
2 parents 265617e + 9f43795 commit e4cdea1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎test/tests.js‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ test('json = true', function () {
6464
$.cookie.json = true;
6565

6666
if ('JSON' in window) {
67-
document.cookie = 'c=' + JSON.stringify({ foo: 'bar' });
67+
$.cookie('c', { foo: 'bar' });
6868
deepEqual($.cookie('c'), { foo: 'bar'}, 'should parse JSON');
6969
} else {
7070
ok(true);
@@ -202,7 +202,7 @@ module('removeCookie', lifecycle);
202202

203203
test('deletion', function() {
204204
expect(1);
205-
document.cookie = 'c=v';
205+
$.cookie('c', 'v');
206206
$.removeCookie('c');
207207
equal(document.cookie, '', 'should delete the cookie');
208208
});
@@ -211,7 +211,7 @@ test('return', function() {
211211
expect(2);
212212
strictEqual($.removeCookie('c'), false, "return false if the cookie wasn't found");
213213

214-
document.cookie = 'c=v';
214+
$.cookie('c', 'v');
215215
strictEqual($.removeCookie('c'), true, 'return true if the cookie was found');
216216
});
217217

0 commit comments

Comments
 (0)