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

index 367d6fb..0479133 100644 (file)
@@ -12,6 +12,7 @@ import javax.inject.Inject
 /**
  * Page that lets the user control the rescue mode for a Sone.
  */
+@MenuName("Rescue")
 class RescuePage @Inject constructor(template: Template, webInterface: WebInterface):
                LoggedInPage("rescue.html", template, "Page.Rescue.Title", webInterface) {
 
index 8bda29a..028119f 100644 (file)
@@ -5,6 +5,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.equalTo
@@ -93,4 +94,9 @@ class RescuePageTest: WebPageTest(::RescuePage) {
            assertThat(baseInjector.getInstance<RescuePage>(), notNullValue())
        }
 
+       @Test
+       fun `page is annotated with correct menuname`() {
+           assertThat(page.menuName, equalTo("Rescue"))
+       }
+
 }