From a0b6fad1ada52457c2c5022fcb7685c1fff16abb Mon Sep 17 00:00:00 2001 From: Bernhard Posselt Date: Fri, 23 May 2014 00:44:27 +0200 Subject: add most of the settings except import --- js/tests/unit/service/SettingsSpec.js | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'js/tests/unit/service') 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 -- cgit v1.2.3