Skip to content

Commit

Permalink
test: use of http_headers and success_code metadata together
Browse files Browse the repository at this point in the history
  • Loading branch information
matteo-cristino committed Oct 23, 2024
1 parent 85e18c6 commit b8d1632
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/fixtures/meta/set_http_headers_response.metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"success_code": "302",
"error_code": "500",
"http_headers": true
}
8 changes: 8 additions & 0 deletions tests/fixtures/meta/set_http_headers_response.schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"type:": "object",
"properties": {
"http_headers": {
"type": "object"
}
}
}
9 changes: 9 additions & 0 deletions tests/fixtures/meta/set_http_headers_response.zen
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
Given I have a 'string dictionary' named 'http_headers'

When I set 'location' to 'https://example.com/cb?code=aaaa' as 'string'
When I create the 'string dictionary' named 'response'

When I move 'location' in 'response'
When I move 'response' in 'http headers'

Then print the 'http_headers'
9 changes: 9 additions & 0 deletions tests/workflow.stepci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ tests:
http_headers:
response:
Cache-Control: no-store
- name: set http_headers response
http:
url: http://${{env.host}}/meta/set_http_headers_response
method: GET
followRedirects: false
check:
headers:
Location: https://example.com/cb?code=aaaa
status: 302

hello:
steps:
Expand Down

0 comments on commit b8d1632

Please sign in to comment.