aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/test/java/com
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-11-01 02:21:32 +0300
committerGravatar Vitaly Takmazov2017-11-01 02:21:32 +0300
commit0dcabe039a51a3a1aebd9a656a8dde2895b5e03a (patch)
tree0cc0ebbe358b08869e4878aa3ec641f69bf16946 /juick-www/src/test/java/com
parent4790deec83f711a797ba23b6d658d516e865dd85 (diff)
www: fix /comment multiparts with empty body
Diffstat (limited to 'juick-www/src/test/java/com')
-rw-r--r--juick-www/src/test/java/com/juick/www/WebAppTests.java10
1 files changed, 9 insertions, 1 deletions
diff --git a/juick-www/src/test/java/com/juick/www/WebAppTests.java b/juick-www/src/test/java/com/juick/www/WebAppTests.java
index 48f465aa..ca1fc29a 100644
--- a/juick-www/src/test/java/com/juick/www/WebAppTests.java
+++ b/juick-www/src/test/java/com/juick/www/WebAppTests.java
@@ -248,6 +248,14 @@ public class WebAppTests {
mockMvc.perform(post("/comment")
.cookie(loginResult.getResponse().getCookies())
.param("mid", String.valueOf(mid))
- .param("body", "yo")).andExpect(redirectedUrl(String.format("/%s/%d#%d", ugnichName, mid, 1)));
+ .param("img", "http://static.juick.com/settings/facebook.png")).andExpect(status().isFound());
+ mockMvc.perform(multipart("/comment")
+ .file(file)
+ .cookie(loginResult.getResponse().getCookies())
+ .param("mid", String.valueOf(mid))).andExpect(status().isFound());
+ mockMvc.perform(post("/comment")
+ .cookie(loginResult.getResponse().getCookies())
+ .param("mid", String.valueOf(mid))
+ .param("body", "yo")).andExpect(redirectedUrl(String.format("/%s/%d#%d", ugnichName, mid, 3)));
}
}