diff options
Diffstat (limited to 'src/test/java/com/juick/server')
-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 0abce093..4b0de65d 100644 --- a/src/test/java/com/juick/server/tests/ServerTests.java +++ b/src/test/java/com/juick/server/tests/ServerTests.java @@ -1799,4 +1799,14 @@ public class ServerTests { messagesService.createMessage(newUserUid, "YO", "", null); assertThat(userService.getUserByUID(newUserUid).get().getSeen(), greaterThanOrEqualTo(now)); } + @Test + public void signupTest() throws Exception { + emailService.addVerificationCode(null, "demo@email.com", "123456"); + MvcResult result = mockMvc.perform(post("/api/signup") + .param("username", "testuser") + .param("password", "demopassword") + .param("verificationCode", "123456")).andExpect(status().isOk()).andReturn(); + com.juick.User testuser = jsonMapper.readValue(result.getResponse().getContentAsString(), User.class); + assertThat(testuser.getName(), is("testuser")); + } } |