Created
April 11, 2014 22:51
-
-
Save jiverson/10507907 to your computer and use it in GitHub Desktop.
Browser poll for angularjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| beforeEach(module('ngCookies', function($provide) { | |
| $provide.factory('$browser', function(){ | |
| return angular.extend(new angular.mock.$Browser(), {cookieHash: {selectedLanguage:undefined}}); | |
| }); | |
| })); | |
| it('cookie for selected should default to english', function() { | |
| expect($cookies).toEqual({'selectedLanguage':undefined}); | |
| // access internal cookie storage of the browser mock directly to simulate behavior of document.cookie | |
| $browser.poll(); | |
| createController(); | |
| expect(catalog.currentLanguage).toBe('en'); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment