summaryrefslogtreecommitdiffstats
path: root/js/tests
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-09-11 22:05:36 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-09-11 22:05:36 +0200
commitc27dab7c808f38135e5b3ed9b8dfac47fc073452 (patch)
treec4102ccd3167599232e1a16ca659cf23e4dfac61 /js/tests
parentac653d89d9cd4c47b211f50d2b8a1a501db2d31d (diff)
add collection view
Diffstat (limited to 'js/tests')
-rw-r--r--js/tests/unit/controller/ContentControllerSpec.js38
1 files changed, 38 insertions, 0 deletions
diff --git a/js/tests/unit/controller/ContentControllerSpec.js b/js/tests/unit/controller/ContentControllerSpec.js
index 097744083..d78c87231 100644
--- a/js/tests/unit/controller/ContentControllerSpec.js
+++ b/js/tests/unit/controller/ContentControllerSpec.js
@@ -14,6 +14,13 @@ describe('ContentController', function () {
beforeEach(module('News', function ($provide) {
$provide.constant('BASE_URL', 'base');
$provide.constant('ITEM_BATCH_SIZE', 5);
+ $provide.constant('FEED_TYPE', {
+ FEED: 0,
+ FOLDER: 1,
+ STARRED: 2,
+ SUBSCRIPTIONS: 3,
+ SHARED: 4
+ });
}));
@@ -428,4 +435,35 @@ describe('ContentController', function () {
expect(ctrl.getRelativeDate('')).toBe('');
}));
+
+
+ it('should tell if a feed is shown', inject(function ($controller,
+ FEED_TYPE) {
+
+ var $route = {
+ current: {
+ $$route: {
+ type: 0
+ }
+ }
+ };
+
+ var ctrl = $controller('ContentController', {
+ $route: $route,
+ FEED_TYPE: FEED_TYPE,
+ data: {}
+ });
+
+
+ Object.keys(FEED_TYPE).forEach(function (key) {
+ $route.current.$$route.type = FEED_TYPE[key];
+ if (key === 'FEED') {
+ expect(ctrl.isFeed()).toBe(true);
+ } else {
+ expect(ctrl.isFeed()).toBe(false);
+ }
+ });
+
+ }));
+
});