X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Ftest%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2Fajax%2FUnbookmarkAjaxPageTest.kt;h=65c5bebcc282f25855c527de8dc6a213ba131f44;hp=23ebd9f595e19d2d9dc00f40e3cc4b0c3cdea1c9;hb=43278c5468221baa16946a5206c3a4e97d543010;hpb=d58ef344b43543fdcfca13c07df87e194f004376 diff --git a/src/test/kotlin/net/pterodactylus/sone/web/ajax/UnbookmarkAjaxPageTest.kt b/src/test/kotlin/net/pterodactylus/sone/web/ajax/UnbookmarkAjaxPageTest.kt index 23ebd9f..65c5beb 100644 --- a/src/test/kotlin/net/pterodactylus/sone/web/ajax/UnbookmarkAjaxPageTest.kt +++ b/src/test/kotlin/net/pterodactylus/sone/web/ajax/UnbookmarkAjaxPageTest.kt @@ -17,15 +17,13 @@ class UnbookmarkAjaxPageTest : JsonPageTest("unbookmark.ajax", requiresLogin = f @Test fun `request without post id results in invalid-post-id`() { - assertThat(json.isSuccess, equalTo(false)) - assertThat(json.error, equalTo("invalid-post-id")) + assertThatJsonFailed("invalid-post-id") } @Test fun `request with empty post id results in invalid-post-id`() { addRequestParameter("post", "") - assertThat(json.isSuccess, equalTo(false)) - assertThat(json.error, equalTo("invalid-post-id")) + assertThatJsonFailed("invalid-post-id") } @Test @@ -40,7 +38,7 @@ class UnbookmarkAjaxPageTest : JsonPageTest("unbookmark.ajax", requiresLogin = f val post = mock() addPost(post, "post-id") addRequestParameter("post", "post-id") - assertThat(json.isSuccess, equalTo(true)) + assertThatJsonIsSuccessful() verify(core).unbookmarkPost(eq(post)) }