Skip to content

Commit

Permalink
Merge pull request carhartl#149 from FagnerMartinsBrack/tests-cookie-…
Browse files Browse the repository at this point in the history
…write

write cookies using $.cookie since the read operation already tests it
  • Loading branch information
carhartl committed Jan 29, 2013
2 parents 265617e + 9f43795 commit e4cdea1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ test('json = true', function () {
$.cookie.json = true;

if ('JSON' in window) {
document.cookie = 'c=' + JSON.stringify({ foo: 'bar' });
$.cookie('c', { foo: 'bar' });
deepEqual($.cookie('c'), { foo: 'bar'}, 'should parse JSON');
} else {
ok(true);
Expand Down Expand Up @@ -202,7 +202,7 @@ module('removeCookie', lifecycle);

test('deletion', function() {
expect(1);
document.cookie = 'c=v';
$.cookie('c', 'v');
$.removeCookie('c');
equal(document.cookie, '', 'should delete the cookie');
});
Expand All @@ -211,7 +211,7 @@ test('return', function() {
expect(2);
strictEqual($.removeCookie('c'), false, "return false if the cookie wasn't found");

document.cookie = 'c=v';
$.cookie('c', 'v');
strictEqual($.removeCookie('c'), true, 'return true if the cookie was found');
});

Expand Down

0 comments on commit e4cdea1

Please sign in to comment.