aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2022-12-22 03:46:12 +0300
committerGravatar Vitaly Takmazov2022-12-22 04:18:27 +0300
commitd4df81c28908c593c2b59f2596e4e380492b32d0 (patch)
tree046e58ccb5075dcbba83a68d031d57a00d6b775a /src/test/java
parent15fbc16291e0a15cf05e9b4477eaf8709833d3a0 (diff)
www: Mastodon-compatible `/share` endpoint
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/com/juick/server/tests/ServerTests.java4
1 files changed, 4 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 236c113b..a892bcf4 100644
--- a/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/src/test/java/com/juick/server/tests/ServerTests.java
@@ -2764,4 +2764,8 @@ public class ServerTests {
assertThat(messagesService.getMessages(ugnich, List.of(mid)).size(), is(1));
assertThat(messagesService.getMessages(ugnich, List.of(mid)).get(0).isUnread(), is(false));
}
+ @Test
+ public void shareUrlShouldRedirectToPost() throws Exception {
+ mockMvc.perform(get("/share?text=Hello\nWorld")).andExpect(redirectedUrl("/post?body=Hello%0AWorld"));
+ }
}