Skip to content

Commit

Permalink
Test if the options are being properly passed to the $.cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
FagnerMartinsBrack committed Aug 7, 2012
1 parent a289022 commit 1e8054a
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -143,4 +143,21 @@ test('return', 2, function() {

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

test('passing options', 2, function() {
var oldCookie = $.cookie;

$.cookie = function( arg0, arg1, arg2 ) {
if( arg1 === null ) {
equal(arg2.test, 'options', 'The options should be passed');
} else {
equal(arg1.test, 'options', 'The options should be passed');
}
};

document.cookie = 'c=v';
$.removeCookie('c', { test: 'options' });

$.cookie = oldCookie;
});

0 comments on commit 1e8054a

Please sign in to comment.