X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FDeleteReplyPageTest.kt;h=eb2d184bd1abc683b51f6026b81815dc2fe339cd;hp=7944321ac1770bdd91ddc2d0c3aad179eec1d780;hb=6b29b49714912ff5e3e410d2484699cdf8041b90;hpb=65e3c95fe9d44b5654b2ac76fc09b9aaac50ca9c diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPageTest.kt index 7944321..eb2d184 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPageTest.kt @@ -6,7 +6,6 @@ import net.pterodactylus.sone.test.mock import net.pterodactylus.sone.test.whenever import net.pterodactylus.sone.web.pages.WebPageTest import net.pterodactylus.sone.web.pages.DeleteReplyPage -import net.pterodactylus.util.web.Method.GET import net.pterodactylus.util.web.Method.POST import org.hamcrest.MatcherAssert.assertThat import org.hamcrest.Matchers.equalTo @@ -45,7 +44,6 @@ class DeleteReplyPageTest : WebPageTest() { @Test fun `get request sets reply ID and return page in template context`() { - request("", GET) addHttpRequestParameter("reply", "reply-id") addHttpRequestParameter("returnPage", "return.html") page.processTemplate(freenetRequest, templateContext) @@ -55,7 +53,7 @@ class DeleteReplyPageTest : WebPageTest() { @Test fun `post request without any action sets reply ID and return page in template context`() { - request("", POST) + setMethod(POST) addPostReply("reply-id", reply) addHttpRequestPart("reply", "reply-id") addHttpRequestPart("returnPage", "return.html") @@ -66,13 +64,13 @@ class DeleteReplyPageTest : WebPageTest() { @Test fun `trying to delete a reply with an invalid ID results in no permission page`() { - request("", POST) + setMethod(POST) verifyRedirect("noPermission.html") } @Test fun `trying to delete a reply from a non-local sone results in no permission page`() { - request("", POST) + setMethod(POST) addHttpRequestPart("reply", "reply-id") whenever(sone.isLocal).thenReturn(false) addPostReply("reply-id", reply) @@ -81,7 +79,7 @@ class DeleteReplyPageTest : WebPageTest() { @Test fun `confirming deletion of reply deletes the reply and redirects to return page`() { - request("", POST) + setMethod(POST) addPostReply("reply-id", reply) addHttpRequestPart("reply", "reply-id") addHttpRequestPart("returnPage", "return.html") @@ -93,7 +91,7 @@ class DeleteReplyPageTest : WebPageTest() { @Test fun `aborting deletion of reply redirects to return page`() { - request("", POST) + setMethod(POST) addPostReply("reply-id", reply) addHttpRequestPart("reply", "reply-id") addHttpRequestPart("returnPage", "return.html")