diff options
author | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-19 16:43:14 +0100 |
---|---|---|
committer | Bernhard Posselt <dev@bernhard-posselt.com> | 2014-11-19 16:43:14 +0100 |
commit | 71269582fa0d07ff91ad80a04e39428ff735748f (patch) | |
tree | bbee92d6ca1d29017ed89b9a62ba1b22135c531f /js/tests/unit | |
parent | 5658386300d4315065484cea3517f9cea87bff0f (diff) |
allow to add feeds from recommended sites
Diffstat (limited to 'js/tests/unit')
-rw-r--r-- | js/tests/unit/controller/ExploreControllerSpec.js | 44 |
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 |