From: David ‘Bombe’ Roden Date: Fri, 17 May 2019 09:29:03 +0000 (+0200) Subject: ✨ Annotate NewPage with MenuName X-Git-Tag: v79^2~45 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=685535f252f0114bd64646867a7f71238bba2d20;p=Sone.git ✨ Annotate NewPage with MenuName --- diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/NewPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/NewPage.kt index 8b4218d..a7bd2fa 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/NewPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/NewPage.kt @@ -13,6 +13,7 @@ import javax.inject.Inject * Page that displays all new posts and replies. The posts are filtered using * [PostVisibilityFilter.isPostVisible(Sone, Post)] and sorted by time. */ +@MenuName("New") class NewPage @Inject constructor( template: Template, webInterface: WebInterface): SoneTemplatePage("new.html", webInterface, template, "Page.New.Title") { diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/NewPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/NewPageTest.kt index 0565c0f..187b666 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/NewPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/NewPageTest.kt @@ -89,4 +89,9 @@ class NewPageTest: WebPageTest(::NewPage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with the correct menuname`() { + assertThat(page.menuName, equalTo("New")) + } + }