✨ Annotate OptionsPage with MenuName
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 17 May 2019 10:08:15 +0000 (12:08 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 17 May 2019 10:08:15 +0000 (12:08 +0200)
src/main/kotlin/net/pterodactylus/sone/web/pages/OptionsPage.kt
src/test/kotlin/net/pterodactylus/sone/web/pages/OptionsPageTest.kt

index dabe9f2..c17cbe2 100644 (file)
@@ -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") {
 
index 8875549..ecee2f4 100644 (file)
@@ -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<OptionsPage>(), notNullValue())
        }
 
+       @Test
+       fun `page is annotated with correct menuname`() {
+           assertThat(page.menuName, equalTo("Options"))
+       }
+
 }