mirror of
https://github.com/usebruno/bruno.git
synced 2025-01-06 22:19:13 +01:00
Merge pull request #3707 from lohxt1/fix/multipart-tests
fix: multipart tests
This commit is contained in:
commit
78aa0d07ae
@ -11,6 +11,7 @@ post {
|
|||||||
}
|
}
|
||||||
|
|
||||||
body:multipart-form {
|
body:multipart-form {
|
||||||
|
foo: {"bar":"baz"} @contentType(application/json--test)
|
||||||
form-data-key: {{form-data-key}}
|
form-data-key: {{form-data-key}}
|
||||||
form-data-stringified-object: {{form-data-stringified-object}}
|
form-data-stringified-object: {{form-data-stringified-object}}
|
||||||
file: @file(bruno.png)
|
file: @file(bruno.png)
|
||||||
@ -19,6 +20,7 @@ body:multipart-form {
|
|||||||
assert {
|
assert {
|
||||||
res.body: contains form-data-value
|
res.body: contains form-data-value
|
||||||
res.body: contains {"foo":123}
|
res.body: contains {"foo":123}
|
||||||
|
res.body: contains Content-Type: application/json--test
|
||||||
}
|
}
|
||||||
|
|
||||||
script:pre-request {
|
script:pre-request {
|
||||||
|
@ -1,24 +0,0 @@
|
|||||||
meta {
|
|
||||||
name: mixed-content-types
|
|
||||||
type: http
|
|
||||||
seq: 1
|
|
||||||
}
|
|
||||||
|
|
||||||
post {
|
|
||||||
url: {{host}}/api/multipart/mixed-content-types
|
|
||||||
body: multipartForm
|
|
||||||
auth: none
|
|
||||||
}
|
|
||||||
|
|
||||||
body:multipart-form {
|
|
||||||
param1: test
|
|
||||||
param2: {"test":"i am json"} @contentType(application/json)
|
|
||||||
param3: @file(multipart/small.png)
|
|
||||||
}
|
|
||||||
|
|
||||||
assert {
|
|
||||||
res.status: eq 200
|
|
||||||
res.body.find(p=>p.name === 'param1').contentType: isUndefined
|
|
||||||
res.body.find(p=>p.name === 'param2').contentType: eq application/json
|
|
||||||
res.body.find(p=>p.name === 'param3').contentType: eq image/png
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user