From 7f181f590fbc7b2062a5348a3b050d7cf884a135 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 25 May 2018 21:00:36 +0300 Subject: TopManager: *NSFW should not appear in Top --- juick-server/src/test/java/com/juick/server/tests/ServerTests.java | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'juick-server/src/test/java/com/juick/server') 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 41f2b68c..8e3e5dfd 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 @@ -584,6 +584,13 @@ public class ServerTests { assertThat(juickTag.TID, is(2)); tagService.updateTags(topmid, Collections.singletonList(juickTag)); assertThat(messagesService.getPopularCandidates().isEmpty(), is(true)); + tagService.updateTags(topmid, Collections.singletonList(juickTag)); + assertThat(messagesService.getPopularCandidates().isEmpty(), is(false)); + jdbcTemplate.update("INSERT INTO tags(tag_id, name) VALUES(805, 'NSFW')"); + Tag nsfw = tagService.getTag("NSFW", false); + assertThat(nsfw.TID, equalTo(805)); + tagService.updateTags(topmid, Collections.singletonList(nsfw)); + assertThat(messagesService.getPopularCandidates().isEmpty(), is(true)); } @Test public void inReplyToScannerTest() { -- cgit v1.2.3