aboutsummaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2019-06-12 14:39:04 +0200
committerHarald Eilertsen <haraldei@anduin.net>2019-06-12 14:41:43 +0200
commit2f600bea194b053b310a181857c5d801471fe7be (patch)
treec6454560a1e2358b216f3d961ede137d70c53725 /tests
parent6584116e9da1a8389867584f079d868722753fca (diff)
downloadrust-zotapi-2f600bea194b053b310a181857c5d801471fe7be.tar.gz
rust-zotapi-2f600bea194b053b310a181857c5d801471fe7be.tar.bz2
rust-zotapi-2f600bea194b053b310a181857c5d801471fe7be.zip
Fix uploading of attachments to posts.
The field needs to be named `media`, and we also need to handle the result of the operation. This refactors the result handling into a separate private function.
Diffstat (limited to 'tests')
-rw-r--r--tests/zotapi.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/zotapi.rs b/tests/zotapi.rs
index 9ad5cf9..1a81dc3 100644
--- a/tests/zotapi.rs
+++ b/tests/zotapi.rs
@@ -114,7 +114,7 @@ fn upload_item_with_media_file() {
"Content-Disposition: form-data; name=\"title\"\r\n" +
"\r\nA title\r\n" +
"--.+\r\n" +
- "Content-Disposition: form-data; name=\"files\"; filename=\"testfile.txt\"\r\n" +
+ "Content-Disposition: form-data; name=\"media\"; filename=\"testfile.txt\"\r\n" +
"Content-Type: text/plain\r\n" +
"\r\ntestfile contents\n" +
"\r\n--.+--\r\n"))
@@ -146,11 +146,11 @@ fn upload_item_with_two_files() {
"Content-Disposition: form-data; name=\"title\"\r\n" +
"\r\nA title\r\n" +
"--.+\r\n" +
- "Content-Disposition: form-data; name=\"files\"; filename=\"testfile.txt\"\r\n" +
+ "Content-Disposition: form-data; name=\"media\"; filename=\"testfile.txt\"\r\n" +
"Content-Type: text/plain\r\n" +
"\r\ntestfile contents\n" +
"\r\n--.+\r\n" +
- "Content-Disposition: form-data; name=\"files\"; filename=\"testfile.txt\"\r\n" +
+ "Content-Disposition: form-data; name=\"media\"; filename=\"testfile.txt\"\r\n" +
"Content-Type: text/plain\r\n" +
"\r\ntestfile contents\n" +
"\r\n--.+--\r\n"))