summaryrefslogtreecommitdiffstats
path: root/js/tests/unit/controller/AppControllerSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests/unit/controller/AppControllerSpec.js')
-rw-r--r--js/tests/unit/controller/AppControllerSpec.js45
1 files changed, 45 insertions, 0 deletions
diff --git a/js/tests/unit/controller/AppControllerSpec.js b/js/tests/unit/controller/AppControllerSpec.js
new file mode 100644
index 000000000..b7dad7492
--- /dev/null
+++ b/js/tests/unit/controller/AppControllerSpec.js
@@ -0,0 +1,45 @@
+/**
+ * ownCloud - News
+ *
+ * This file is licensed under the Affero General Public License version 3 or
+ * later. See the COPYING file.
+ *
+ * @author Bernhard Posselt <dev@bernhard-posselt.com>
+ * @copyright Bernhard Posselt 2014
+ */
+describe('AppController', function () {
+ 'use strict';
+
+ var controller;
+
+ beforeEach(module('News'));
+
+ beforeEach(inject(function ($controller) {
+ controller = $controller('AppController');
+ }));
+
+
+ it('should expose Loading', inject(function (Loading) {
+ expect(controller.loading).toBe(Loading);
+ }));
+
+
+ it('should expose set firstrun if no feeds and folders', inject(function () {
+ expect(controller.isFirstRun()).toBe(true);
+ }));
+
+
+ it('should expose set firstrun if feeds', inject(function (Feed) {
+ Feed.add({url: 'test'});
+
+ expect(controller.isFirstRun()).toBe(false);
+ }));
+
+
+ it('should expose set firstrun if folders', inject(function (Folder) {
+ Folder.add({name: 'test'});
+
+ expect(controller.isFirstRun()).toBe(false);
+ }));
+
+}); \ No newline at end of file