X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FCreateSonePageTest.kt;h=a01a6a72a2cdd7660ede532f3ec92be085a5c50f;hp=f14d536fc98074b5e480fca1e1978994f7a9c924;hb=6b29b49714912ff5e3e410d2484699cdf8041b90;hpb=de7568a82eb4150bf6d2b0553841b7b69f84c968 diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateSonePageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateSonePageTest.kt index f14d536..a01a6a7 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateSonePageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/CreateSonePageTest.kt @@ -85,8 +85,8 @@ class CreateSonePageTest: WebPageTest() { @Test fun `sone is created and logged in`() { addExistingOwnIdentities() - request("", POST) - addHttpRequestParameter("identity", "own-id-3") + setMethod(POST) + addHttpRequestPart("identity", "own-id-3") val newSone = mock() whenever(core.createSone(ownIdentities_[2])).thenReturn(newSone) verifyRedirect("index.html") { @@ -96,7 +96,7 @@ class CreateSonePageTest: WebPageTest() { @Test fun `on invalid identity id a flag is set in the template context`() { - request("", POST) + setMethod(POST) addHttpRequestParameter("identity", "own-id-3") page.processTemplate(freenetRequest, templateContext) assertThat(templateContext["errorNoIdentity"], equalTo(true)) @@ -105,8 +105,8 @@ class CreateSonePageTest: WebPageTest() { @Test fun `if sone is not created user is still redirected to index`() { addExistingOwnIdentities() - request("", POST) - addHttpRequestParameter("identity", "own-id-3") + setMethod(POST) + addHttpRequestPart("identity", "own-id-3") whenever(core.createSone(ownIdentities_[2])).thenReturn(null) verifyRedirect("index.html") { verify(core).createSone(ownIdentities_[2])