feat($cookieStore): $cookieStore.get now parses blank string as blank string

closes #1918
This commit is contained in:
Illniyar
2013-04-20 23:33:40 +03:00
committed by Pete Bacon Darwin
parent 4f2e360685
commit cf4729faa3
2 changed files with 13 additions and 1 deletions

View File

@@ -125,4 +125,15 @@ describe('$cookieStore', function() {
$rootScope.$digest();
expect($browser.cookies()).toEqual({});
}));
it('should handle empty string value cookies', inject(function ($cookieStore, $browser, $rootScope) {
$cookieStore.put("emptyCookie",'');
$rootScope.$digest();
expect($browser.cookies()).
toEqual({ 'emptyCookie': '""' });
expect($cookieStore.get("emptyCookie")).toEqual('');
$browser.cookieHash['blankCookie'] = '';
$browser.poll();
expect($cookieStore.get("blankCookie")).toEqual('');
}))
});