From 3db634e425d3482bcf00dfd82e4b0d46785d5959 Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Fri, 17 May 2019 11:45:54 +0200 Subject: [PATCH] =?utf8?q?=E2=9C=A8=20Annotate=20KnownSonesPage=20with=20M?= =?utf8?q?enuName?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPage.kt | 1 + .../kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPage.kt index 59b79e7..dd96832 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPage.kt @@ -12,6 +12,7 @@ import javax.inject.Inject /** * This page shows all known Sones. */ +@MenuName("KnownSones") class KnownSonesPage @Inject constructor(template: Template, webInterface: WebInterface): SoneTemplatePage("knownSones.html", webInterface, template, "Page.KnownSones.Title") { diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt index ef837be..bc46b9d 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/KnownSonesPageTest.kt @@ -13,6 +13,7 @@ import net.pterodactylus.sone.test.mock import net.pterodactylus.sone.test.whenever import net.pterodactylus.sone.utils.Pagination import net.pterodactylus.sone.web.baseInjector +import net.pterodactylus.sone.web.page.* import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.contains import org.hamcrest.Matchers.equalTo @@ -250,4 +251,9 @@ class KnownSonesPageTest: WebPageTest(::KnownSonesPage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with the correct menuname`() { + assertThat(page.menuName, equalTo("KnownSones")) + } + } -- 2.7.4