118 lines
3.3 KiB
YAML
118 lines
3.3 KiB
YAML
# 1. Test success paths for filtering revisions for the following filters:
|
|
# * tag
|
|
# 2. Test failure paths for filtering revisions for the following filters:
|
|
# * tag
|
|
# 3. Test success paths for sorting and ordering.
|
|
|
|
defaults:
|
|
request_headers:
|
|
content-type: application/x-yaml
|
|
response_headers:
|
|
content-type: application/x-yaml
|
|
|
|
tests:
|
|
- name: purge
|
|
desc: Begin testing from known state.
|
|
DELETE: /api/v1.0/revisions
|
|
status: 204
|
|
response_headers: null
|
|
|
|
- name: initialize
|
|
desc: Create first revision for testing
|
|
PUT: /api/v1.0/buckets/bucket_a/documents
|
|
status: 200
|
|
data: <@resources/design-doc-layering-sample-3-layers.yaml
|
|
|
|
- name: initialize_again
|
|
desc: Create second revision for testing
|
|
PUT: /api/v1.0/buckets/bucket_b/documents
|
|
status: 200
|
|
data: <@resources/sample-doc.yaml
|
|
|
|
- name: initialize_once_again
|
|
desc: Create third revision for testing
|
|
PUT: /api/v1.0/buckets/bucket_c/documents
|
|
status: 200
|
|
data: <@resources/sample-schema.yaml
|
|
|
|
- name: create_tag
|
|
desc: Create a tag for testing filtering a revision by tag
|
|
POST: /api/v1.0/revisions/$HISTORY['initialize'].$RESPONSE['$.[0].status.revision']/tags/foo
|
|
status: 201
|
|
|
|
- name: create_another_tag
|
|
desc: Create another tag for testing filtering a revision by many tags
|
|
POST: /api/v1.0/revisions/$HISTORY['initialize'].$RESPONSE['$.[0].status.revision']/tags/bar
|
|
status: 201
|
|
|
|
- name: verify_revision_list_for_one_valid_filter
|
|
desc: Verify that revision is returned for filter tag="foo"
|
|
GET: /api/v1.0/revisions
|
|
query_parameters:
|
|
tag: foo
|
|
status: 200
|
|
response_multidoc_jsonpaths:
|
|
$.`len`: 1
|
|
$.[0].count: 1
|
|
$.[0].results[0].id: $HISTORY['initialize'].$RESPONSE['$.[0].status.revision']
|
|
$.[0].results[0].buckets: [bucket_a]
|
|
$.[0].results[0].tags:
|
|
# Tags are sorted alphabetically.
|
|
- bar
|
|
- foo
|
|
|
|
- name: verify_revision_list_for_many_valid_filters
|
|
desc: Verify that revision is returned for filter tag="foo" or tag="bar"
|
|
GET: /api/v1.0/revisions
|
|
query_parameters:
|
|
tag:
|
|
- foo
|
|
- bar
|
|
status: 200
|
|
response_multidoc_jsonpaths:
|
|
$.`len`: 1
|
|
$.[0].count: 1
|
|
$.[0].results[0].id: $HISTORY['initialize'].$RESPONSE['$.[0].status.revision']
|
|
$.[0].results[0].buckets: [bucket_a]
|
|
$.[0].results[0].tags:
|
|
- bar
|
|
- foo
|
|
|
|
- name: verify_revision_list_for_invalid_filter
|
|
desc: Verify that no revisions are returned for tag="baz"
|
|
GET: /api/v1.0/revisions
|
|
query_parameters:
|
|
tag: baz
|
|
status: 200
|
|
response_multidoc_jsonpaths:
|
|
$.`len`: 1
|
|
$.[0].count: 0
|
|
$.[0].results: []
|
|
|
|
- name: verify_sort_by_id
|
|
desc: Verify revision documents sorted by ID, in ascending order
|
|
GET: /api/v1.0/revisions
|
|
query_parameters:
|
|
sort: id
|
|
status: 200
|
|
response_multidoc_jsonpaths:
|
|
$.[0].results.`len`: 3
|
|
$.[0].results[*].id:
|
|
- 1
|
|
- 2
|
|
- 3
|
|
|
|
- name: verify_sort_by_id_desc
|
|
desc: Verify revision documents sorted by ID, in descending order
|
|
GET: /api/v1.0/revisions
|
|
query_parameters:
|
|
sort: id
|
|
order: desc
|
|
status: 200
|
|
response_multidoc_jsonpaths:
|
|
$.[0].results.`len`: 3
|
|
$.[0].results[*].id:
|
|
- 3
|
|
- 2
|
|
- 1
|