From 87482530f0361af55a17780981d6819269aada67 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:08:15 +0200 Subject: [PATCH] =?utf8?q?=E2=9C=A8=20Annotate=20OptionsPage=20with=20Menu?= =?utf8?q?Name?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/net/pterodactylus/sone/web/pages/OptionsPage.kt | 1 + src/test/kotlin/net/pterodactylus/sone/web/pages/OptionsPageTest.kt | 6 ++++++ 2 files changed, 7 insertions(+) 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")) + } + } -- 2.7.4