summaryrefslogtreecommitdiffstats
path: root/js/tests/unit/service
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-05-23 00:44:27 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-05-23 00:44:27 +0200
commita0b6fad1ada52457c2c5022fcb7685c1fff16abb (patch)
treef3d89fcbb203dfa9b5ea2f92213567abf13bb813 /js/tests/unit/service
parent7bcdc3d062996918c8cb59bf827a3db3229b8544 (diff)
add most of the settings except import
Diffstat (limited to 'js/tests/unit/service')
-rw-r--r--js/tests/unit/service/SettingsSpec.js22
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