diff options
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/java/com/juick/server/tests/ServerTests.java | 10 |
1 files changed, 10 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 e113c44a..901d1501 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -2211,4 +2211,14 @@ public class ServerTests { .orElseThrow(); assertThat(htmlPM, is(getSnapshot(testPrivateHtmlEmail))); } + @Test + public void readonlyTest() throws Exception { + var result = commandsManager.processCommand(ugnich, "YO", emptyUri); + var mid = result.getNewMessage().get().getMid(); + jdbcTemplate.update("UPDATE messages SET readonly=1 WHERE message_id=?", mid); + var readonlyResult = commandsManager.processCommand(freefd, String.format("#%d PEOPLE", mid), emptyUri); + assertThat(readonlyResult.getNewMessage().isPresent(), is(false)); + var authorResult = commandsManager.processCommand(ugnich, String.format("#%d PEOPLE", mid), emptyUri); + assertThat(authorResult.getNewMessage().isPresent(), is(true)); + } } |