X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;ds=sidebyside;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fpages%2FUnbookmarkPageTest.kt;h=c6c37a5069c649e7ad52b1e7e197e9c8d3f7dcaa;hb=5ba707d40f9d2a20094aaabc21647aeec1feed46;hp=b18211fb104829209bb1fd54390552dd11010b5d;hpb=de7568a82eb4150bf6d2b0553841b7b69f84c968;p=Sone.git diff --git a/src/test/kotlin/net/pterodactylus/sone/web/pages/UnbookmarkPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/pages/UnbookmarkPageTest.kt index b18211f..c6c37a5 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/pages/UnbookmarkPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/pages/UnbookmarkPageTest.kt @@ -3,7 +3,6 @@ package net.pterodactylus.sone.web.pages import net.pterodactylus.sone.data.Post import net.pterodactylus.sone.test.mock import net.pterodactylus.sone.test.whenever -import net.pterodactylus.sone.web.pages.UnbookmarkPage import net.pterodactylus.util.web.Method.POST import org.junit.Test import org.mockito.Mockito.any @@ -42,9 +41,9 @@ class UnbookmarkPageTest : WebPageTest() { @Test fun `post request does not unbookmark not-present post but redirects to return page`() { - request("", POST) - addHttpRequestParameter("post", "post-id") - addHttpRequestParameter("returnPage", "return.html") + setMethod(POST) + addHttpRequestPart("post", "post-id") + addHttpRequestPart("returnPage", "return.html") verifyRedirect("return.html") { verify(core, never()).unbookmarkPost(any()) } @@ -52,9 +51,9 @@ class UnbookmarkPageTest : WebPageTest() { @Test fun `post request unbookmarks present post and redirects to return page`() { - request("", POST) - addHttpRequestParameter("post", "post-id") - addHttpRequestParameter("returnPage", "return.html") + setMethod(POST) + addHttpRequestPart("post", "post-id") + addHttpRequestPart("returnPage", "return.html") val post = mock().apply { whenever(isLoaded).thenReturn(true) } addPost("post-id", post) verifyRedirect("return.html") {