✨ Annotate EditProfilePage with MenuName
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 17 May 2019 09:48:35 +0000 (11:48 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 17 May 2019 09:48:35 +0000 (11:48 +0200)
src/main/kotlin/net/pterodactylus/sone/web/pages/EditProfilePage.kt
src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt

index 7999c8f..e2392b4 100644 (file)
@@ -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) {
 
index 98b1f6c..45af39d 100644 (file)
@@ -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<EditProfilePage>(), notNullValue())
        }
 
+       @Test
+       fun `page is annotated with correct menuname`() {
+           assertThat(page.menuName, equalTo("EditProfile"))
+       }
+
 }