From: David ‘Bombe’ Roden Date: Sat, 8 Apr 2017 22:25:06 +0000 (+0200) Subject: Add some tests for the edit profile page X-Git-Tag: 0.9.7^2~252 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7f1e72376b822e5364068693686a99662690163b;p=Sone.git Add some tests for the edit profile page --- diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt index c79bbcf..46a73cc 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt @@ -46,6 +46,22 @@ class EditProfilePageTest : WebPageTest() { } @Test + fun `page returns correct path`() { + assertThat(page.path, equalTo("editProfile.html")) + } + + @Test + fun `page requires login`() { + assertThat(page.requiresLogin(), equalTo(true)) + } + + @Test + fun `page returns correct title`() { + whenever(l10n.getString("Page.EditProfile.Title")).thenReturn("edit profile page title") + assertThat(page.getPageTitle(freenetRequest), equalTo("edit profile page title")) + } + + @Test fun `get request stores fields of current sone’s profile in template context`() { request("", GET) page.handleRequest(freenetRequest, templateContext)