From: David ‘Bombe’ Roden Date: Sun, 30 Apr 2017 13:53:10 +0000 (+0200) Subject: Add more tests to image browser page test X-Git-Tag: 0.9.7^2~231 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=cee09da2887a2a3d86d8e694c3fbdcd1f74cefce;p=Sone.git Add more tests to image browser page test --- diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPageTest.kt index 7a12242..19d24ed 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/ImageBrowserPageTest.kt @@ -21,6 +21,22 @@ class ImageBrowserPageTest : WebPageTest() { private val page = ImageBrowserPage(template, webInterface) @Test + fun `page returns correct path`() { + assertThat(page.path, equalTo("imageBrowser.html")) + } + + @Test + fun `page requires login`() { + assertThat(page.requiresLogin(), equalTo(true)) + } + + @Test + fun `page returns correct title`() { + whenever(l10n.getString("Page.ImageBrowser.Title")).thenReturn("image browser page title") + assertThat(page.getPageTitle(freenetRequest), equalTo("image browser page title")) + } + + @Test fun `get request with album sets album and page in template context`() { request("", GET) val album = mock()