From d938bdc5ae96ba48ce86e3ccd9e7affa78374a8e Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Sun, 4 Jun 2017 12:08:03 +0200 Subject: [PATCH] Add more tests for unlock Sone page --- .../pterodactylus/sone/web/pages/UnlockSonePageTest.kt | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/UnlockSonePageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/UnlockSonePageTest.kt index 70756e1..1a0d63b 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/UnlockSonePageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/UnlockSonePageTest.kt @@ -4,6 +4,8 @@ import net.pterodactylus.sone.data.Sone import net.pterodactylus.sone.test.mock import net.pterodactylus.sone.test.whenever import net.pterodactylus.util.web.Method.POST +import org.hamcrest.MatcherAssert.assertThat +import org.hamcrest.Matchers.equalTo import org.junit.Test import org.mockito.ArgumentMatchers.any import org.mockito.Mockito.never @@ -19,6 +21,22 @@ class UnlockSonePageTest : WebPageTest() { override fun getPage() = page @Test + fun `page returns correct path`() { + assertThat(page.path, equalTo("unlockSone.html")) + } + + @Test + fun `page does not require login`() { + assertThat(page.requiresLogin(), equalTo(false)) + } + + @Test + fun `page returns correct title`() { + addTranslation("Page.UnlockSone.Title", "unlock page title") + assertThat(page.getPageTitle(freenetRequest), equalTo("unlock page title")) + } + + @Test fun `post request without sone redirects to return page`() { setMethod(POST) addHttpRequestPart("returnPage", "return.html") -- 2.7.4