diff options
Diffstat (limited to 'js/tests/unit/service')
-rw-r--r-- | js/tests/unit/service/SettingsSpec.js | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/js/tests/unit/service/SettingsSpec.js b/js/tests/unit/service/SettingsSpec.js index b76251e3a..06bb365b6 100644 --- a/js/tests/unit/service/SettingsSpec.js +++ b/js/tests/unit/service/SettingsSpec.js @@ -10,7 +10,16 @@ describe('Settings', () => { 'use strict'; - beforeEach(module('News')); + let http; + + beforeEach(module('News', ($provide) => { + $provide.value('BASE_URL', 'base'); + })); + + beforeEach(inject(($httpBackend) => { + http = $httpBackend; + })); + it('should receive default settings', inject((Settings) => { Settings.receive({ @@ -22,9 +31,20 @@ describe('Settings', () => { it('should set values', inject((Settings) => { + http.expectPOST('base/settings', {showAll: true}).respond(200, {}); + Settings.set('showAll', true); + http.flush(); + expect(Settings.get('showAll')).toBe(true); })); + + afterEach(() => { + http.verifyNoOutstandingExpectation(); + http.verifyNoOutstandingRequest(); + }); + + });
\ No newline at end of file |