From 9cc0a2b7be5347b46de71cbfcf7fd7c71cd2f3f5 Mon Sep 17 00:00:00 2001 From: Vit Brunner Date: Sun, 21 Dec 2014 21:28:27 +0100 Subject: [PATCH] Simplify filter test --- source/tests/services/filter.js.coffee | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/source/tests/services/filter.js.coffee b/source/tests/services/filter.js.coffee index 5101fad..5123ed9 100644 --- a/source/tests/services/filter.js.coffee +++ b/source/tests/services/filter.js.coffee @@ -1,5 +1,4 @@ filter = {} -poems = {} poemList = {} module "filter", { @@ -37,21 +36,14 @@ module "filter", { Code: 'dolu' }} - angular.module('sideBySide').service('poems', () -> - @all = [ - poemList.poe - poemList.vrch - poemList.muz - poemList.dolu - ] - @getActive = () -> - (poem for poem in @all when poem.meta.Active is true) - @getInactive = () -> - (poem for poem in @all when poem.meta.Active is not true) - @ - ) - - filter = angular.injector(['ng', 'sideBySide']).get('filter') + poems = injector.get('poems') + poems.all = [ + poemList.poe + poemList.vrch + poemList.muz + poemList.dolu + ] + filter = injector.get('filter') } test "get filter for poems that share a common property", () ->