From: David ‘Bombe’ Roden Date: Sun, 4 Jun 2017 09:26:40 +0000 (+0200) Subject: Add more tests for unfollow Sone page X-Git-Tag: 0.9.7^2~179 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=ea0b4376bd51bd6e13c1d5e0801c55fa52801163;p=Sone.git Add more tests for unfollow Sone page --- diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/UnfollowSonePageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/UnfollowSonePageTest.kt index 7e19a26..9357c47 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/UnfollowSonePageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/UnfollowSonePageTest.kt @@ -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 { } }