X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FDeleteReplyPageTest.kt;h=c03afc877b35e11ce19d4eebe693171241d69995;hb=5ba707d40f9d2a20094aaabc21647aeec1feed46;hp=7944321ac1770bdd91ddc2d0c3aad179eec1d780;hpb=05fb821e72072bde52f383bdc5a988da67f66d0c;p=Sone.git 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..c03afc8 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/DeleteReplyPageTest.kt @@ -4,9 +4,6 @@ import net.pterodactylus.sone.data.PostReply import net.pterodactylus.sone.data.Sone 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 +42,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 +51,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 +62,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 +77,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 +89,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")