Add more tests for unfollow Sone page
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 4 Jun 2017 09:26:40 +0000 (11:26 +0200)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Sun, 4 Jun 2017 09:55:29 +0000 (11:55 +0200)
src/test/kotlin/net/pterodactylus/sone/web/pages/UnfollowSonePageTest.kt

index 7e19a26..9357c47 100644 (file)
@@ -1,6 +1,8 @@
 package net.pterodactylus.sone.web.pages
 
 import net.pterodactylus.util.web.Method.POST
+import org.hamcrest.MatcherAssert.assertThat
+import org.hamcrest.Matchers.equalTo
 import org.junit.Test
 import org.mockito.Mockito.verify
 
@@ -14,6 +16,22 @@ class UnfollowSonePageTest : WebPageTest() {
        override fun getPage() = page
 
        @Test
+       fun `page returns correct path`() {
+           assertThat(page.path, equalTo("unfollowSone.html"))
+       }
+
+       @Test
+       fun `page requires login`() {
+           assertThat(page.requiresLogin(), equalTo(true))
+       }
+
+       @Test
+       fun `page returns correct page title`() {
+           addTranslation("Page.UnfollowSone.Title", "unfollow page title")
+               assertThat(page.getPageTitle(freenetRequest), equalTo("unfollow page title"))
+       }
+
+       @Test
        fun `get request does not redirect`() {
                verifyNoRedirect { }
        }