From ebee3657f9638aae9cc16a5df5ef5ec4e41afd68 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:05:10 +0200 Subject: [PATCH] =?utf8?q?=E2=9C=A8=20Annotate=20AboutPage=20with=20MenuNa?= =?utf8?q?me?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/net/pterodactylus/sone/web/pages/AboutPage.kt | 3 ++- src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/AboutPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/AboutPage.kt index b55511a..422364a 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/AboutPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/AboutPage.kt @@ -2,7 +2,7 @@ package net.pterodactylus.sone.web.pages import net.pterodactylus.sone.main.* import net.pterodactylus.sone.web.WebInterface -import net.pterodactylus.sone.web.page.FreenetRequest +import net.pterodactylus.sone.web.page.* import net.pterodactylus.util.template.Template import net.pterodactylus.util.template.TemplateContext import javax.inject.Inject @@ -10,6 +10,7 @@ import javax.inject.Inject /** * A [SoneTemplatePage] that stores information about Sone in the [TemplateContext]. */ +@MenuName("About") class AboutPage @Inject constructor(template: Template, webInterface: WebInterface, private val pluginVersion: PluginVersion, private val pluginYear: PluginYear, diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt index 156b361..1be5fa6 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/AboutPageTest.kt @@ -4,6 +4,7 @@ import net.pterodactylus.sone.main.* import net.pterodactylus.sone.test.getInstance import net.pterodactylus.sone.test.isProvidedByMock import net.pterodactylus.sone.web.baseInjector +import net.pterodactylus.sone.web.page.* import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo import org.hamcrest.Matchers.notNullValue @@ -58,4 +59,9 @@ class AboutPageTest : WebPageTest({ template, webInterface -> AboutPage(template assertThat(injector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct menuname`() { + assertThat(page.menuName, equalTo("About")) + } + } -- 2.7.4