From: David ‘Bombe’ Roden Date: Fri, 17 May 2019 10:08:15 +0000 (+0200) Subject: ✨ Annotate OptionsPage with MenuName X-Git-Tag: v79^2~34 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=87482530f0361af55a17780981d6819269aada67;p=Sone.git ✨ Annotate OptionsPage with MenuName --- diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/OptionsPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/OptionsPage.kt index dabe9f2..c17cbe2 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/OptionsPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/OptionsPage.kt @@ -15,6 +15,7 @@ import javax.inject.Inject /** * This page lets the user edit the options of the Sone plugin. */ +@MenuName("Options") class OptionsPage @Inject constructor(template: Template, webInterface: WebInterface): SoneTemplatePage("options.html", webInterface, template, "Page.Options.Title") { diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/OptionsPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/OptionsPageTest.kt index 8875549..ecee2f4 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/OptionsPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/OptionsPageTest.kt @@ -9,6 +9,7 @@ import net.pterodactylus.sone.fcp.FcpInterface.FullAccessRequired.WRITING 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 net.pterodactylus.util.web.Method.POST import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo @@ -384,4 +385,9 @@ class OptionsPageTest: WebPageTest(::OptionsPage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct menuname`() { + assertThat(page.menuName, equalTo("Options")) + } + }