From d4df81c28908c593c2b59f2596e4e380492b32d0 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 22 Dec 2022 03:46:12 +0300 Subject: www: Mastodon-compatible `/share` endpoint --- src/test/java/com/juick/server/tests/ServerTests.java | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/test/java/com/juick/server/tests') 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")); + } } -- cgit v1.2.3