.andExpect(content().string(containsString("Add New Post")));
}
@Test
public void redirectToPublishedPostAfterCreation() throws Exception {
MockHttpServletRequestBuilder createPostRequest = getCreatePostRequest();
createPostRequest.param("title", "Post Title");
createPostRequest.param("content", "My Content");
createPostRequest.param("category", PostCategory.NEWS_AND_EVENTS.name());
createPostRequest.param("draft", "false");
createPostRequest.param("publishAt", "2013-07-01 13:15");
mockMvc.perform(createPostRequest)
.andExpect(status().isFound())
.andExpect(result -> {
String redirectedUrl = result.getResponse().getRedirectedUrl();