From: David ‘Bombe’ Roden Date: Fri, 17 May 2019 10:05:10 +0000 (+0200) Subject: ✨ Annotate AboutPage with MenuName X-Git-Tag: v79^2~40 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ebee3657f9638aae9cc16a5df5ef5ec4e41afd68;p=Sone.git ✨ Annotate AboutPage with MenuName --- 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")) + } + }