summaryrefslogtreecommitdiffstats
path: root/js/tests
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2016-03-25 15:31:17 +0100
committerBernhard Posselt <dev@bernhard-posselt.com>2016-03-25 19:48:06 +0100
commit0d5c4e438e001ef21dfae69df4ae186b697d2efc (patch)
tree82e00390f6bac6fbcb1bb09479982167b5e792f4 /js/tests
parentf7520a8fe7191475668904f5f8c1816df25e2e5a (diff)
add basic basic auth support
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/controller/NavigationControllerSpec.js10
-rw-r--r--js/tests/unit/service/FeedResourceSpec.js16
2 files changed, 18 insertions, 8 deletions
diff --git a/js/tests/unit/controller/NavigationControllerSpec.js b/js/tests/unit/controller/NavigationControllerSpec.js
index 904455c5c..d353880c4 100644
--- a/js/tests/unit/controller/NavigationControllerSpec.js
+++ b/js/tests/unit/controller/NavigationControllerSpec.js
@@ -324,7 +324,7 @@ describe('NavigationController', function () {
callback({feeds: [{
id: 3,
url: url,
- folderId: folderId
+ folderId: folderId,
}]});
return {
finally: function (callback) {
@@ -361,7 +361,7 @@ describe('NavigationController', function () {
expect(ctrl.showNewFolder).toBe(false);
expect(FeedResource.create).toHaveBeenCalledWith('test', 3,
- undefined);
+ undefined, undefined, undefined);
expect(Publisher.publishAll).toHaveBeenCalledWith({feeds: [{
id: 3,
url: 'test',
@@ -430,14 +430,16 @@ describe('NavigationController', function () {
var feed = {
url: 'test',
- newFolder: 'john'
+ newFolder: 'john',
+ user: 'user',
+ password: 'password'
};
ctrl.createFeed(feed);
expect(ctrl.showNewFolder).toBe(false);
expect(FeedResource.create).toHaveBeenCalledWith('test', 19,
- undefined);
+ undefined, 'user', 'password');
expect(FolderResource.create).toHaveBeenCalledWith('john');
expect(Publisher.publishAll).toHaveBeenCalledWith({
folders: [{
diff --git a/js/tests/unit/service/FeedResourceSpec.js b/js/tests/unit/service/FeedResourceSpec.js
index 95767e633..45e088fce 100644
--- a/js/tests/unit/service/FeedResourceSpec.js
+++ b/js/tests/unit/service/FeedResourceSpec.js
@@ -157,10 +157,12 @@ describe('FeedResource', function () {
http.expectPOST('base/feeds', {
parentFolderId: 5,
url: 'https://hey',
- title: 'abc'
+ title: 'abc',
+ user: 'john',
+ password: 'doe'
}).respond(200, {});
- FeedResource.create(' hey ', 5, ' abc');
+ FeedResource.create(' hey ', 5, ' abc', 'john', 'doe');
http.flush();
@@ -172,7 +174,9 @@ describe('FeedResource', function () {
http.expectPOST('base/feeds', {
parentFolderId: 5,
url: 'http://hey',
- title: 'abc'
+ title: 'abc',
+ user: null,
+ password: null
}).respond(200, {});
FeedResource.create('http://hey', 5, 'abc');
@@ -187,7 +191,9 @@ describe('FeedResource', function () {
http.expectPOST('base/feeds', {
parentFolderId: 5,
url: 'https://hey',
- title: 'abc'
+ title: 'abc',
+ user: null,
+ password: null
}).respond(400, {message: 'noo'});
FeedResource.create('https://hey', 5, 'abc');
@@ -203,6 +209,8 @@ describe('FeedResource', function () {
http.expectPOST('base/feeds', {
parentFolderId: 0,
url: 'https://hey',
+ user: null,
+ password: null
}).respond(200, {});
FeedResource.create('hey', undefined);