Skip to content

Commit

Permalink
Check that body links are in the json instead of the document
Browse files Browse the repository at this point in the history
  • Loading branch information
ioannakok committed Apr 17, 2024
1 parent e9c5c19 commit ee221c9
Showing 1 changed file with 7 additions and 4 deletions.
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 ee221c9

Please sign in to comment.