From: David ‘Bombe’ Roden Date: Fri, 17 May 2019 09:41:00 +0000 (+0200) Subject: ✨ Annotate CreateSonePage with MenuName X-Git-Tag: v79^2~43 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=fd54b109f461c97e527924b4a3752430298f586a;p=Sone.git ✨ Annotate CreateSonePage with MenuName --- 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")) + } + }