Test openapi schema requestBody

This commit is contained in:
2021-03-15 02:01:39 +01:00
parent 9c88adbabd
commit 97b07fb424
12 changed files with 155 additions and 87 deletions

View File

@@ -5,6 +5,7 @@ import integration.steps.then.`And the response should contain`
import integration.steps.then.`Then the response should be`
import integration.steps.`when`.`When I send a GET request`
import integration.steps.`when`.`When I send a PUT request`
import integration.steps.`when`.`with body`
import integration.steps.then.and
import integration.steps.given.`Given I have article`
import integration.steps.given.`Given I have citizen`
@@ -30,11 +31,11 @@ class `Vote routes` : BaseTest() {
`Given I have article`(id = "835c5101-ca39-4038-a4e6-da6ee62ca6d5")
`When I send a PUT request`("/articles/835c5101-ca39-4038-a4e6-da6ee62ca6d5/vote") {
`authenticated as`("Thalès", "Milet")
"""
`with body`("""
{
"note": 1
}
"""
""")
} `Then the response should be` Created
}
}
@@ -46,11 +47,11 @@ class `Vote routes` : BaseTest() {
`Given I have constitution`(id = "76e79c89-efc1-492d-9e8f-dc9717363a11")
`When I send a PUT request`("/constitutions/76e79c89-efc1-492d-9e8f-dc9717363a11/vote") {
`authenticated as`("Gregor", "Mendel")
"""
`with body`("""
{
"note": 1
}
"""
""")
} `Then the response should be` Created
}
}
@@ -101,11 +102,11 @@ class `Vote routes` : BaseTest() {
)
`When I send a PUT request`("/comments/e793eccc-456b-4450-a292-46d592229b74/vote") {
`authenticated as`("Antoine", "Lavoisier")
"""
`with body`("""
{
"note": -1
}
"""
""")
} `Then the response should be` Created and {
`And the response should contain`("$.down", 1)
}