From: David ‘Bombe’ Roden Date: Sat, 8 Apr 2017 17:03:52 +0000 (+0200) Subject: Add some tests for edit profile field page X-Git-Tag: 0.9.7^2~255 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=e6b3d4f3022e392ac0d74ba1c298b3dbf7265603;p=Sone.git Add some tests for edit profile field page --- diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfileFieldPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfileFieldPageTest.kt index cbe1289..0990ece 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfileFieldPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfileFieldPageTest.kt @@ -31,6 +31,22 @@ class EditProfileFieldPageTest : WebPageTest() { } @Test + fun `page returns correct path`() { + assertThat(page.path, equalTo("editProfileField.html")) + } + + @Test + fun `page requires login`() { + assertThat(page.requiresLogin(), equalTo(true)) + } + + @Test + fun `page returns correct title`() { + whenever(l10n.getString("Page.EditProfileField.Title")).thenReturn("edit profile field title") + assertThat(page.getPageTitle(freenetRequest), equalTo("edit profile field title")) + } + + @Test fun `get request with invalid field redirects to invalid page`() { request("", GET) verifyRedirect("invalid.html")