From fe0689ea60c46a0d62e9598adf7fd25c0182fa7b 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:52 +0200 Subject: [PATCH] =?utf8?q?=E2=9C=A8=20Annotate=20RescuePage=20with=20MenuN?= =?utf8?q?ame?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/net/pterodactylus/sone/web/pages/RescuePage.kt | 1 + src/test/kotlin/net/pterodactylus/sone/web/pages/RescuePageTest.kt | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/RescuePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/RescuePage.kt index 367d6fb..0479133 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/RescuePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/RescuePage.kt @@ -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) { diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/RescuePageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/RescuePageTest.kt index 8bda29a..028119f 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/RescuePageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/RescuePageTest.kt @@ -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(), notNullValue()) } + @Test + fun `page is annotated with correct menuname`() { + assertThat(page.menuName, equalTo("Rescue")) + } + } -- 2.7.4