Add test for no-login requirement.
authorDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Wed, 18 Dec 2013 23:58:00 +0000 (00:58 +0100)
committerDavid ‘Bombe’ Roden <bombe@pterodactylus.net>
Fri, 28 Feb 2014 21:26:08 +0000 (22:26 +0100)
src/test/java/net/pterodactylus/sone/web/ajax/BookmarkAjaxPageTest.java

index a4b6a90..0239464 100644 (file)
@@ -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);