From: David ‘Bombe’ Roden Date: Fri, 17 May 2019 10:07:13 +0000 (+0200) Subject: ✨ Annotate LoginPage with MenuName X-Git-Tag: v79^2~36 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=4fa7cbf1a4014897563cce41a338bb2925183c0e;p=Sone.git ✨ Annotate LoginPage with MenuName --- diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/LoginPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/LoginPage.kt index 20251c0..96e8b27 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/LoginPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/LoginPage.kt @@ -13,6 +13,7 @@ import javax.inject.Inject /** * The login page lets the user log in. */ +@MenuName("Login") class LoginPage @Inject constructor(template: Template, webInterface: WebInterface): SoneTemplatePage("login.html", webInterface, template, "Page.Login.Title") { diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/LoginPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/LoginPageTest.kt index 9d29a55..794e68b 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/LoginPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/LoginPageTest.kt @@ -8,6 +8,7 @@ import net.pterodactylus.sone.test.mock import net.pterodactylus.sone.test.thenReturnMock import net.pterodactylus.sone.test.whenever import net.pterodactylus.sone.web.baseInjector +import net.pterodactylus.sone.web.page.* import net.pterodactylus.util.web.Method.POST import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.contains @@ -146,4 +147,9 @@ class LoginPageTest: WebPageTest(::LoginPage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct menuname`() { + assertThat(page.menuName, equalTo("Login")) + } + }