aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/com/juick/server/tests
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java/com/juick/server/tests')
-rw-r--r--src/test/java/com/juick/server/tests/ServerTests.java10
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 ce9b49d0..5a32c9ef 100644
--- a/src/test/java/com/juick/server/tests/ServerTests.java
+++ b/src/test/java/com/juick/server/tests/ServerTests.java
@@ -2534,6 +2534,16 @@ public class ServerTests {
mockMvc.perform(get(htmlUri)).andExpect(status().isOk());
mockMvc.perform(get(ldUri)).andExpect(status().isOk());
}
+ @Test
+ public void jsonRequestToRootShouldRespondWithJsonContent() throws Exception {
+ var jsonHeader = "application/json";
+ mockMvc.perform(get("/").accept(jsonHeader))
+ .andExpect(status().isOk())
+ .andExpect(content().contentType(MediaType.APPLICATION_JSON_VALUE));
+ HtmlPage htmlPage = webClient.getPage("/");
+ assertThat(htmlPage.isHtmlPage(), is(true));
+ assertThat(htmlPage.getTitleText(), is("Discuss"));
+ }
@Test
@Transactional