From dbfecdac857030a686d76907008a3a49cde20d2b 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:36 +0200 Subject: [PATCH] =?utf8?q?=E2=9C=A8=20Annotate=20BookmarksPage=20with=20Me?= =?utf8?q?nuName?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/main/kotlin/net/pterodactylus/sone/web/pages/BookmarksPage.kt | 1 + .../kotlin/net/pterodactylus/sone/web/pages/BookmarksPageTest.kt | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/main/kotlin/net/pterodactylus/sone/web/pages/BookmarksPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/pages/BookmarksPage.kt index f6cdd0b..c73ce3d 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/pages/BookmarksPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/pages/BookmarksPage.kt @@ -11,6 +11,7 @@ import javax.inject.Inject /** * Page that lets the user browse all his bookmarked posts. */ +@MenuName("Bookmarks") class BookmarksPage @Inject constructor(template: Template, webInterface: WebInterface) : SoneTemplatePage("bookmarks.html", webInterface, template, "Page.Bookmarks.Title") { diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/BookmarksPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/BookmarksPageTest.kt index 2186f61..b3882e5 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/BookmarksPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/BookmarksPageTest.kt @@ -6,6 +6,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 @@ -64,4 +65,10 @@ class BookmarksPageTest: WebPageTest(::BookmarksPage) { assertThat(baseInjector.getInstance(), notNullValue()) } + @Test + fun `page is annotated with correct menuname`() { + assertThat(page.menuName, equalTo("Bookmarks")) + } + + } -- 2.7.4