From 88e4eca0efda12a7631c0c6675fdb53a3b44c80a Mon Sep 17 00:00:00 2001 From: Rowanne Kabalan Date: Fri, 6 Sep 2024 12:34:54 +0100 Subject: [PATCH 1/2] Remove references to Books and Art pillars --- .../utils/CapiModelEnrichment.scala | 3 +-- .../model/utils/CapiModelEnrichmentTest.scala | 10 ++-------- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/client/src/main/scala/com.gu.contentapi.client/utils/CapiModelEnrichment.scala b/client/src/main/scala/com.gu.contentapi.client/utils/CapiModelEnrichment.scala index 8940fed1..b2fbee4a 100644 --- a/client/src/main/scala/com.gu.contentapi.client/utils/CapiModelEnrichment.scala +++ b/client/src/main/scala/com.gu.contentapi.client/utils/CapiModelEnrichment.scala @@ -186,7 +186,6 @@ object CapiModelEnrichment { (tagExistsWithId("tone/comment")(content) && isPillar("News")(content)) || (tagExistsWithId("tone/letters")(content) && isPillar("News")(content)) || isPillar("Opinion")(content) - val isCulture: ContentFilter = content => isPillar("Arts")(content) || isPillar("Books")(content) val predicates: List[(ContentFilter, Theme)] = List( isSpecialReport -> SpecialReportTheme, @@ -194,7 +193,7 @@ object CapiModelEnrichment { tagExistsWithId("tone/advertisement-features") -> Labs, isOpinion -> OpinionPillar, isPillar("Sport") -> SportPillar, - isCulture -> CulturePillar, + isPillar("Culture") -> CulturePillar, isPillar("Lifestyle") -> LifestylePillar ) diff --git a/client/src/test/scala/com.gu.contentapi.client/model/utils/CapiModelEnrichmentTest.scala b/client/src/test/scala/com.gu.contentapi.client/model/utils/CapiModelEnrichmentTest.scala index 1e7a2c31..f7664d16 100644 --- a/client/src/test/scala/com.gu.contentapi.client/model/utils/CapiModelEnrichmentTest.scala +++ b/client/src/test/scala/com.gu.contentapi.client/model/utils/CapiModelEnrichmentTest.scala @@ -513,19 +513,13 @@ class CapiModelEnrichmentFormatTest extends AnyFlatSpec with MockitoSugar with M f.content.theme shouldEqual SportPillar } - it should "return a theme of 'CulturePillar' when has a pillarName of 'Arts'" in { + it should "return a theme of 'CulturePillar' when has a pillarName of 'Culture'" in { val f = fixture - when(f.content.pillarName) thenReturn Some("Arts") + when(f.content.pillarName) thenReturn Some("Culture") f.content.theme shouldEqual CulturePillar } - it should "return a theme of 'CulturePillar' when has a pillarName of 'Books'" in { - val f = fixture - when(f.content.pillarName) thenReturn Some("Books") - - f.content.theme shouldEqual CulturePillar - } it should "return a theme of 'LifestylePillar' when has a pillarName of 'Lifestyle'" in { val f = fixture From 8144ebb8e24fab1c8299114bd7360020d2d7590f Mon Sep 17 00:00:00 2001 From: Rowanne Kabalan Date: Tue, 10 Sep 2024 10:54:12 +0100 Subject: [PATCH 2/2] Restore check for Arts --- .../com.gu.contentapi.client/utils/CapiModelEnrichment.scala | 3 ++- .../model/utils/CapiModelEnrichmentTest.scala | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/client/src/main/scala/com.gu.contentapi.client/utils/CapiModelEnrichment.scala b/client/src/main/scala/com.gu.contentapi.client/utils/CapiModelEnrichment.scala index b2fbee4a..dc8000ad 100644 --- a/client/src/main/scala/com.gu.contentapi.client/utils/CapiModelEnrichment.scala +++ b/client/src/main/scala/com.gu.contentapi.client/utils/CapiModelEnrichment.scala @@ -186,6 +186,7 @@ object CapiModelEnrichment { (tagExistsWithId("tone/comment")(content) && isPillar("News")(content)) || (tagExistsWithId("tone/letters")(content) && isPillar("News")(content)) || isPillar("Opinion")(content) + val isCulture: ContentFilter = content => isPillar("Arts")(content) val predicates: List[(ContentFilter, Theme)] = List( isSpecialReport -> SpecialReportTheme, @@ -193,7 +194,7 @@ object CapiModelEnrichment { tagExistsWithId("tone/advertisement-features") -> Labs, isOpinion -> OpinionPillar, isPillar("Sport") -> SportPillar, - isPillar("Culture") -> CulturePillar, + isCulture -> CulturePillar, isPillar("Lifestyle") -> LifestylePillar ) diff --git a/client/src/test/scala/com.gu.contentapi.client/model/utils/CapiModelEnrichmentTest.scala b/client/src/test/scala/com.gu.contentapi.client/model/utils/CapiModelEnrichmentTest.scala index f7664d16..c4eed9e4 100644 --- a/client/src/test/scala/com.gu.contentapi.client/model/utils/CapiModelEnrichmentTest.scala +++ b/client/src/test/scala/com.gu.contentapi.client/model/utils/CapiModelEnrichmentTest.scala @@ -513,9 +513,9 @@ class CapiModelEnrichmentFormatTest extends AnyFlatSpec with MockitoSugar with M f.content.theme shouldEqual SportPillar } - it should "return a theme of 'CulturePillar' when has a pillarName of 'Culture'" in { + it should "return a theme of 'CulturePillar' when has a pillarName of 'Arts'" in { val f = fixture - when(f.content.pillarName) thenReturn Some("Culture") + when(f.content.pillarName) thenReturn Some("Arts") f.content.theme shouldEqual CulturePillar }