aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/test/java/com/juick/server/tests
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/test/java/com/juick/server/tests')
-rw-r--r--juick-server/src/test/java/com/juick/server/tests/ServerTests.java21
1 files changed, 20 insertions, 1 deletions
diff --git a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java
index c43ed9bd..af5b20ec 100644
--- a/juick-server/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/juick-server/src/test/java/com/juick/server/tests/ServerTests.java
@@ -670,7 +670,6 @@ public class ServerTests {
@Test
public void protocolTests() throws Exception {
- URI emptyUri = URI.create(StringUtils.EMPTY);
int uid = userService.createUser("me", "secret");
User user = userService.getUserByUID(uid).orElse(AnonymousUser.INSTANCE);
Tag yo = tagService.getTag("yo", true);
@@ -1047,4 +1046,24 @@ public class ServerTests {
.with(httpBasic(ugnichName, ugnichPassword)))
.andExpect(jsonPath("$.hash", is(hash)));
}
+ @Test
+ public void feedsShouldNotContainBannedUsers() throws Exception {
+ commandsManager.processCommand(ugnich, "BL @freefd", emptyUri);
+ CommandResult result = commandsManager.processCommand(ugnich, "freefd - dick", emptyUri);
+ int mid = result.getNewMessage().get().getMid();
+ commandsManager.processCommand(freefd, String.format("#%d ugnich - dick too", mid), emptyUri);
+ commandsManager.processCommand(juick, String.format("#%d/1 ban for a hour!", mid), emptyUri);
+ commandsManager.processCommand(juick, String.format("#%d freefd is here but it is hidden from you", mid), emptyUri);
+ assertThat(messagesService.getMessage(mid).getReplies(), is(3));
+ List<Message> replies = messagesService.getReplies(ugnich, mid);
+ assertThat(replies.size(), is(1));
+ commandsManager.processCommand(freefd, String.format("#%d/3 hahaha!", mid), emptyUri);
+ assertThat(messagesService.getMessage(mid).getReplies(), is(4));
+ replies = messagesService.getReplies(ugnich, mid);
+ assertThat(replies.size(), is(1));
+ commandsManager.processCommand(juick, String.format("#%d/4 mmm?!", mid), emptyUri);
+ assertThat(messagesService.getMessage(mid).getReplies(), is(5));
+ replies = messagesService.getReplies(ugnich, mid);
+ assertThat(replies.size(), is(1));
+ }
}