From fd54b109f461c97e527924b4a3752430298f586a Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 17 May 2019 11:41:00 +0200 Subject: [PATCH] =?utf8?q?=E2=9C=A8=20Annotate=20CreateSonePage=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/CreateSonePage.kt | 1 + .../kotlin/net/pterodactylus/sone/web/pages/CreateSonePageTest.kt | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateSonePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateSonePage.kt index 78f981c..3abb927 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateSonePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/CreateSonePage.kt @@ -14,6 +14,7 @@ import javax.inject.Inject /** * The “create Sone” page lets the user create a new Sone. */ +@MenuName("CreateSone") class CreateSonePage @Inject constructor(template: Template, webInterface: WebInterface): SoneTemplatePage("createSone.html", webInterface, template, "Page.CreateSone.Title") { diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateSonePageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateSonePageTest.kt index 547347a..9b5f983 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateSonePageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateSonePageTest.kt @@ -7,6 +7,7 @@ import net.pterodactylus.sone.test.getInstance import net.pterodactylus.sone.test.mock 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 @@ -150,4 +151,9 @@ class CreateSonePageTest : WebPageTest(::CreateSonePage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with the correct menuname`() { + assertThat(page.menuName, equalTo("CreateSone")) + } + } -- 2.7.4