aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-02-17 10:17:14 +0300
committerGravatar Vitaly Takmazov2022-02-17 10:17:14 +0300
commitb38edd75f5142da515e46dbbc667162186a77653 (patch)
tree3a24f5f993d3b25fc5cfd02f92c680ed3ad77ade /src/test/java
parentd95517f241f415c8603faac93f4efc8eea14dd15 (diff)
Do not allow to delete Telegram when it is the only social account
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/com/juick/server/tests/ServerTests.java5
1 files changed, 5 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 1ef8fe7f..df247b66 100644
--- a/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/src/test/java/com/juick/server/tests/ServerTests.java
@@ -2160,8 +2160,13 @@ public class ServerTests {
@Test
public void verifiedUsersTest() {
assertThat(userService.getUserByName("ugnich").isVerified(), is(false));
+ jdbcTemplate.update("INSERT INTO telegram(user_id, tg_id) VALUES(?, ?)", ugnich.getUid(), "100001866137681");
+ assertThat(userService.canDeleteTelegramUser(userService.getUserByName("ugnich")), is(false));
jdbcTemplate.update("INSERT INTO facebook(user_id, fb_id) VALUES(?, ?)", ugnich.getUid(), "100001866137681");
assertThat(userService.getUserByName("ugnich").isVerified(), is(true));
+ assertThat(userService.canDeleteTelegramUser(userService.getUserByName("ugnich")), is(true));
+ jdbcTemplate.update("DELETE FROM facebook");
+ assertThat(userService.canDeleteTelegramUser(userService.getUserByName("ugnich")), is(false));
}
@Test