From e0a45f08a56ebbda2394650cb417b661b2ac100c Mon Sep 17 00:00:00 2001 From: Vit Brunner Date: Sun, 21 Dec 2014 22:25:39 +0100 Subject: [PATCH] Fix poem inactivity checking --- source/scripts/services/poems.js.coffee | 4 ++-- source/tests/services/poems.js.coffee | 4 ++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/source/scripts/services/poems.js.coffee b/source/scripts/services/poems.js.coffee index d378d17..25bb53e 100644 --- a/source/scripts/services/poems.js.coffee +++ b/source/scripts/services/poems.js.coffee @@ -15,12 +15,12 @@ angular.module("sideBySide").service "poems", () -> # # @return [Array] Active poems @getActive = () -> - (poem for poem in @all when poem.meta.Active is true) + (poem for poem in @all when poem.meta.Active == true) # Get inactive poems # # @return [Array] Inactive poems @getInactive = () -> - (poem for poem in @all when poem.meta.Active is not true) + (poem for poem in @all when poem.meta.Active != true) @ diff --git a/source/tests/services/poems.js.coffee b/source/tests/services/poems.js.coffee index b85353e..8697ba7 100644 --- a/source/tests/services/poems.js.coffee +++ b/source/tests/services/poems.js.coffee @@ -15,6 +15,9 @@ setPoems = () -> }, { meta: { Active: true } content: [{ section: '3', text: 'three' }] + }, { + meta: { } + content: [{ section: '4', text: 'four' }] }] test "has default content", () -> @@ -32,3 +35,4 @@ test "gets inactive", () -> setPoems() inactive = poems.getInactive() equal inactive[0].content[0].section, '2' + equal inactive[1].content[0].section, '4'