From: David ‘Bombe’ Roden Date: Wed, 24 May 2017 19:35:42 +0000 (+0200) Subject: Add more tests for options page X-Git-Tag: 0.9.7^2~198 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=4e822a612bedf423ec395f55da13cfb68975f2ef;p=Sone.git Add more tests for options page --- diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/OptionsPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/OptionsPageTest.kt index a4df75d..c7b3423 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/OptionsPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/OptionsPageTest.kt @@ -53,6 +53,22 @@ class OptionsPageTest : WebPageTest() { } @Test + fun `page returns correct path`() { + assertThat(page.path, equalTo("options.html")) + } + + @Test + fun `page does not require login`() { + assertThat(page.requiresLogin(), equalTo(false)) + } + + @Test + fun `page returns correct title`() { + addTranslation("Page.Options.Title", "options page title") + assertThat(page.getPageTitle(freenetRequest), equalTo("options page title")) + } + + @Test fun `get request stores all preferences in the template context`() { verifyNoRedirect { assertThat(templateContext["auto-follow"], equalTo(true))