summaryrefslogtreecommitdiffstats
path: root/js/tests/unit/controller/ExploreControllerSpec.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/tests/unit/controller/ExploreControllerSpec.js')
-rw-r--r--js/tests/unit/controller/ExploreControllerSpec.js44
1 files changed, 44 insertions, 0 deletions
diff --git a/js/tests/unit/controller/ExploreControllerSpec.js b/js/tests/unit/controller/ExploreControllerSpec.js
new file mode 100644
index 000000000..71856c8ce
--- /dev/null
+++ b/js/tests/unit/controller/ExploreControllerSpec.js
@@ -0,0 +1,44 @@
+/**
+ * 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('ExploreController', function () {
+ 'use strict';
+
+ var controller,
+ scope,
+ sites;
+
+ beforeEach(module('News'));
+
+ beforeEach(inject(function ($controller, $rootScope) {
+ scope = $rootScope.$new();
+ sites = {
+ data: 'hi'
+ };
+
+ controller = $controller('ExploreController', {
+ $rootScope: scope,
+ sites: sites
+ });
+ }));
+
+
+ it('should expose sites', inject(function () {
+ expect(controller.sites).toBe(sites.data);
+ }));
+
+
+ it('should broadcast add feed', inject(function () {
+ scope.$broadcast = jasmine.createSpy('broadcast');
+
+ controller.subscribeTo('test');
+ expect(scope.$broadcast).toHaveBeenCalledWith('addFeed', 'test');
+ }));
+
+}); \ No newline at end of file