diff options
author | Vitaly Takmazov | 2019-09-18 11:35:55 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-09-18 11:35:55 +0300 |
commit | 32c7f35bda7ed3bdad93db4cce0dd17e7f48c3bd (patch) | |
tree | 7e41b69ad86b2f78d9e3ed37c889715408b5be7e /src/test | |
parent | 13993e1cf558baf27e8381b934286afb49b65371 (diff) |
Readonly messages
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)); + } } |