summaryrefslogtreecommitdiffstats
path: root/js/tests/unit/controller/SettingsControllerSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests/unit/controller/SettingsControllerSpec.js')
-rw-r--r--js/tests/unit/controller/SettingsControllerSpec.js8
1 files changed, 4 insertions, 4 deletions
diff --git a/js/tests/unit/controller/SettingsControllerSpec.js b/js/tests/unit/controller/SettingsControllerSpec.js
index 63b74abae..280d86db4 100644
--- a/js/tests/unit/controller/SettingsControllerSpec.js
+++ b/js/tests/unit/controller/SettingsControllerSpec.js
@@ -62,12 +62,12 @@ describe('SettingsController', function () {
it('should import articles', inject(function ($controller, ItemResource,
Publisher) {
- var data = 1;
+ var response = {data: 1};
ItemResource.importArticles = jasmine.createSpy('importArticles')
.and.callFake(function () {
return {
- success: function (callback) {
- callback(data);
+ then: function (callback) {
+ callback(response.data);
return {
finally: function (finalCallback) {
finalCallback();
@@ -89,7 +89,7 @@ describe('SettingsController', function () {
expect(ItemResource.importArticles)
.toHaveBeenCalledWith(JSON.parse(content));
- expect(Publisher.publishAll).toHaveBeenCalledWith(data);
+ expect(Publisher.publishAll).toHaveBeenCalledWith(response.data);
expect(ctrl.isArticlesImporting).toBe(false);
expect(ctrl.articleImportError).toBe(false);
}));