From: David ‘Bombe’ Roden Date: Wed, 18 Dec 2013 23:58:00 +0000 (+0100) Subject: Add test for no-login requirement. X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=7c8172d1de09a6444956963343ee3509f14b164c;p=Sone.git Add test for no-login requirement. --- diff --git a/src/test/java/net/pterodactylus/sone/web/ajax/BookmarkAjaxPageTest.java b/src/test/java/net/pterodactylus/sone/web/ajax/BookmarkAjaxPageTest.java index a4b6a90..0239464 100644 --- a/src/test/java/net/pterodactylus/sone/web/ajax/BookmarkAjaxPageTest.java +++ b/src/test/java/net/pterodactylus/sone/web/ajax/BookmarkAjaxPageTest.java @@ -6,6 +6,8 @@ package net.pterodactylus.sone.web.ajax; import static net.pterodactylus.sone.Verifiers.verifyJsonError; import static net.pterodactylus.sone.Verifiers.verifySuccessfulJsonResponse; +import static org.hamcrest.MatcherAssert.assertThat; +import static org.hamcrest.Matchers.is; import static org.mockito.Matchers.anyString; import static org.mockito.Matchers.eq; import static org.mockito.Mockito.never; @@ -34,6 +36,11 @@ public class BookmarkAjaxPageTest { private final BookmarkAjaxPage bookmarkAjaxPage = new BookmarkAjaxPage(webInterface); @Test + public void bookmarkingDoesNotRequireLogin() { + assertThat(bookmarkAjaxPage.requiresLogin(), is(false)); + } + + @Test public void testBookmarkingExistingPost() throws URISyntaxException { JsonReturnObject jsonReturnObject = performRequest("/ajax/bookmark.ajax?post=abc", bookmarkAjaxPage); verifySuccessfulJsonResponse(jsonReturnObject);