From: David ‘Bombe’ Roden Date: Fri, 17 May 2019 10:07:39 +0000 (+0200) Subject: ✨ Annotate LogoutPage with MenuName X-Git-Tag: v79^2~35 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=5479681d7a9aa211a775ca448d568f81ec12df7a;p=Sone.git ✨ Annotate LogoutPage with MenuName --- diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/LogoutPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/LogoutPage.kt index 563f03b..6978739 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/LogoutPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/LogoutPage.kt @@ -11,6 +11,7 @@ import javax.inject.Inject /** * Logs a user out. */ +@MenuName("Logout") class LogoutPage @Inject constructor(template: Template, webInterface: WebInterface): LoggedInPage("logout.html", template, "Page.Logout.Title", webInterface) { diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/LogoutPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/LogoutPageTest.kt index f3bed3c..ef40e55 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/LogoutPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/LogoutPageTest.kt @@ -3,6 +3,7 @@ package net.pterodactylus.sone.web.pages import net.pterodactylus.sone.test.getInstance import net.pterodactylus.sone.test.whenever import net.pterodactylus.sone.web.baseInjector +import net.pterodactylus.sone.web.page.* import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo import org.hamcrest.Matchers.notNullValue @@ -74,4 +75,9 @@ class LogoutPageTest: WebPageTest(::LogoutPage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct menuname`() { + assertThat(page.menuName, equalTo("Logout")) + } + }