Skip to content

Commit

Permalink
Merge pull request #27023 from guardian/render-old-liveblogs-via-dcr
Browse files Browse the repository at this point in the history
Render old liveblogs via DCR
  • Loading branch information
ioannakok authored Apr 18, 2024
2 parents 5c9c924 + 5e1f071 commit 67dd46d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
4 changes: 0 additions & 4 deletions article/app/services/dotcomrendering/ArticlePicker.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@ object ArticlePageChecks {

def isNotAGallery(page: PageWithStoryPackage): Boolean = !page.item.tags.isGallery

def isNotLiveBlog(page: PageWithStoryPackage): Boolean = !page.item.tags.isLiveBlog

def isNotPaidContent(page: PageWithStoryPackage): Boolean = !page.item.tags.isPaidContent
}

Expand All @@ -29,7 +27,6 @@ object ArticlePicker {
Map(
("isSupportedType", ArticlePageChecks.isSupportedType(page)),
("isNotAGallery", ArticlePageChecks.isNotAGallery(page)),
("isNotLiveBlog", ArticlePageChecks.isNotLiveBlog(page)),
)
}

Expand All @@ -39,7 +36,6 @@ object ArticlePicker {
Set(
"isSupportedType",
"isNotAGallery",
"isNotLiveBlog",
),
)

Expand Down
11 changes: 7 additions & 4 deletions article/test/ArticleControllerTest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,13 @@ import services.newsletters.{NewsletterApi, NewsletterSignupAgent}
}

it should "count in body links" in {
val result = articleController.renderArticle(liveBlogUrl)(TestRequest(liveBlogUrl))
val body = contentAsString(result)
body should include(""""inBodyInternalLinkCount":38""")
body should include(""""inBodyExternalLinkCount":42""")
val fakeRequest = FakeRequest("GET", s"$liveBlogUrl.json?dcr")
.withHeaders("Origin" -> "http://www.theorigin.com")

val result = articleController.renderArticle(liveBlogUrl)(fakeRequest)
val content = contentAsString(result)
content should include(""""inBodyInternalLinkCount":38""")
content should include(""""inBodyExternalLinkCount":42""")
}

it should "not cache 404s" in {
Expand Down

0 comments on commit 67dd46d

Please sign in to comment.