From 7c8172d1de09a6444956963343ee3509f14b164c Mon Sep 17 00:00:00 2001 From: =?utf8?q?David=20=E2=80=98Bombe=E2=80=99=20Roden?= Date: Thu, 19 Dec 2013 00:58:00 +0100 Subject: [PATCH] Add test for no-login requirement. --- .../java/net/pterodactylus/sone/web/ajax/BookmarkAjaxPageTest.java | 7 +++++++ 1 file changed, 7 insertions(+) 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); -- 2.7.4