diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/test/java/com/juick/server/tests/ServerTests.java b/src/test/java/com/juick/server/tests/ServerTests.java index 925d42f6..aea9447f 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -352,6 +352,7 @@ public class ServerTests { subscriptionService.unSubscribeUser(freefd, ugnich); assertThat(subscriptionService.getSubscribedUsers(ugnich.getUid(), msg).size(), equalTo(0)); Message mentionMessage = new Message(); + mentionMessage.setUser(ugnich); mentionMessage.setText("@freefd - dick"); assertThat(subscriptionService.getSubscribedUsers(ugnich.getUid(), mentionMessage).size(), equalTo(1)); subscriptionService.subscribeUser(freefd, ugnich); @@ -1408,6 +1409,19 @@ public class ServerTests { privacyQueriesService.blacklistUser(mentioner, commenter); assertThat(subscriptionService.getUsersSubscribedToComments(msg, reply).size(), is(0)); } + @Test + public void mentionsInPosts() { + jdbcTemplate.execute("DELETE FROM bl_users"); + int mid = messagesService.createMessage(ugnich.getUid(), "@freefd is dick", null, null); + Message msg = messagesService.getMessage(mid).get(); + assertThat(subscriptionService.getSubscribedUsers(ugnich.getUid(), msg).get(0), is(freefd)); + privacyQueriesService.blacklistUser(freefd, ugnich); + assertThat(subscriptionService.getSubscribedUsers(ugnich.getUid(), msg).size(), is(0)); + int mid2 = messagesService.createMessage(freefd.getUid(), "@ugnich is dick", null, null); + Message msg2 = messagesService.getMessage(mid2).get(); + assertThat(subscriptionService.getSubscribedUsers(freefd.getUid(), msg2).get(0), is(ugnich)); + jdbcTemplate.execute("DELETE FROM bl_users"); + } @Test public void credentialsShouldNeverBeSerialized() throws Exception { |