Commit 3f0ce49c authored by Art4's avatar Art4

API Blueprint und features für multible Texte ergänzt

refs #2406
parent cd400f7b
Pipeline #158681709 passed with stages
in 4 minutes and 3 seconds
......@@ -19,6 +19,34 @@ Scenario: I can send BBCode and receive HTML
And the "content" property exists
And the "content" property is a string equalling "<p><b>Bold text</b></p>"
Scenario: I can send multible BBCode texts and receive HTML texts
Given I have set the "content-type" header with "json"
Given I have the payload
"""
{"data":[{"id":"random-string1","content-type":"text/plain","content":"[b]Bold text[/b]"},{"id":"random-string2","content-type":"text/plain","content":"[i]Italic text[/i]"}]}
"""
When I request "POST /editor/parser?target=html"
Then I get a "200" response
And the Content-Type Header "json" exists
And the "data" property exists
And the "data" property is an array
And scope into the first "data" property
And the response contains at least 3 items
And the "id" property exists
And the "id" property is a string equalling "random-string1"
And the "content-type" property exists
And the "content-type" property is a string equalling "text/html"
And the "content" property exists
And the "content" property is a string equalling "<p><b>Bold text</b></p>"
And scope into the "data.1" property
And the response contains at least 3 items
And the "id" property exists
And the "id" property is a string equalling "random-string2"
And the "content-type" property exists
And the "content-type" property is a string equalling "text/html"
And the "content" property exists
And the "content" property is a string equalling "<p><i>Italic text</i></p>"
Scenario: I send the wrong content type header
Given I have set the "content-type" header with "text/html"
Given I have the payload
......
......@@ -12,6 +12,48 @@ HOST: https://youthweb.net
+ Request (json)
Mehrere Texte gleichzeitig parsen lassen
+ Body
{
"data":[
{
"id": "random-string1",
"content-type": "text/plain",
"content": "[b]Bold text[/b]"
},
{
"id": "random-string2",
"content-type": "text/plain",
"content": "[i]Italic text[/i]"
}
]
}
+ Response 200 (json)
+ Body
{
"data":[
{
"id": "random-string1",
"content-type": "text/html",
"content": "<p><b>Bold text</b></p>"
},
{
"id": "random-string2",
"content-type": "text/html",
"content": "<p><i>Italic text</i></p>"
}
]
}
+ Request (json)
Nur einen eizigen Text parsen lassen
+ Body
{"data":{"content-type":"text/plain","content":"[b]Bold text[/b]"}}
......@@ -24,7 +66,7 @@ HOST: https://youthweb.net
+ Request (text/html)
Wenn der Content-Type falsch angegeben wurde, bekommt man einen 404 Error
Wenn der Content-Type falsch angegeben wurde, bekommt man einen 404 Error
+ Body
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment