Add some tests for the edit profile page
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 8 Apr 2017 22:25:06 +0000 (00:25 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sat, 8 Apr 2017 22:25:06 +0000 (00:25 +0200)
src/test/kotlin/net/pterodactylus/sone/web/pages/EditProfilePageTest.kt

index c79bbcf..46a73cc 100644 (file)
@@ -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)