Add more tests for options page
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 24 May 2017 19:35:42 +0000 (21:35 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 24 May 2017 19:35:42 +0000 (21:35 +0200)
src/test/kotlin/net/pterodactylus/sone/web/pages/OptionsPageTest.kt

index a4df75d..c7b3423 100644 (file)
@@ -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<Any>(true))