From 58cf2922c76f6c75c55d2835cae2d18930c65cfc 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:48:35 +0200 Subject: [PATCH] =?utf8?q?=E2=9C=A8=20Annotate=20EditProfilePage=20with=20?= =?utf8?q?MenuName?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfilePage.kt | 1 + .../kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfilePage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfilePage.kt index 7999c8f..e2392b4 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfilePage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfilePage.kt @@ -13,6 +13,7 @@ import javax.inject.Inject /** * This page lets the user edit her profile. */ +@MenuName("EditProfile") class EditProfilePage @Inject constructor(template: Template, webInterface: WebInterface) : LoggedInPage("editProfile.html", template, "Page.EditProfile.Title", webInterface) { diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt index 98b1f6c..45af39d 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt @@ -6,6 +6,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.contains @@ -225,4 +226,9 @@ class EditProfilePageTest: WebPageTest(::EditProfilePage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct menuname`() { + assertThat(page.menuName, equalTo("EditProfile")) + } + } -- 2.7.4