Skip to content

Commit

Permalink
Put back the unit test I just deleted, and just changed Cookies.defau…
Browse files Browse the repository at this point in the history
…lts.path to support it
  • Loading branch information
ScottHamper committed Apr 28, 2012
1 parent c866419 commit fa3b216
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions tests/spec/cookies-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ describe('Cookies', function () {
});
});

Cookies.defaults.path = undefined;
var cookieKey = 'cookies-spec.js';

describe('.set(key, value [, options])', function () {
it('returns the "Cookies" object', function () {
expect(Cookies.set(cookieKey)).toBe(Cookies);
Expand Down Expand Up @@ -78,6 +80,12 @@ describe('Cookies', function () {
expect(Cookies.set(cookieKey, 1).get(cookieKey)).toEqual(Cookies(cookieKey));
});

it('returns the most locally scoped cookie value for a specific key', function () {
Cookies.set(cookieKey, 2, { path: '/' });
expect(Cookies.get(cookieKey)).toEqual(1);
Cookies.expire(cookieKey, { path: '/' });
});

it('returns "undefined" for cookies that don\'t exist', function () {
Cookies.expire(cookieKey);
expect(Cookies.get(cookieKey)).toBeUndefined();
Expand Down

0 comments on commit fa3b216

Please sign in to comment.