From 5479681d7a9aa211a775ca448d568f81ec12df7a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 17 May 2019 12:07:39 +0200 Subject: [PATCH 1/1] =?utf8?q?=E2=9C=A8=20Annotate=20LogoutPage=20with=20M?= =?utf8?q?enuName?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/net/pterodactylus/sone/web/pages/LogoutPage.kt | 1 + src/test/kotlin/net/pterodactylus/sone/web/pages/LogoutPageTest.kt | 6 ++++++ 2 files changed, 7 insertions(+) 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")) + } + } -- 2.7.4