72 lines
2.3 KiB
YAML
72 lines
2.3 KiB
YAML
# Tests the following:
|
|
#
|
|
# 1) Creation of a single document
|
|
# 2) Implicit creation of a revision
|
|
# 3) Verify revision was created
|
|
# 4) Delete the revision
|
|
# 5) Verify the revision was deleted
|
|
|
|
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
|
|
|
|
# Validates whether creating a revision works.
|
|
# Required parameters:
|
|
# body: Any document payload.
|
|
# Asserts that status code and response headers are correct.
|
|
- name: initialize
|
|
desc: Create initial documents
|
|
PUT: /api/v1.0/buckets/mop/documents
|
|
status: 200
|
|
data: <@resources/design-doc-layering-sample.yaml
|
|
|
|
# Validates whether revision was created.
|
|
# Required parameters:
|
|
# path: revision_id.
|
|
# Asserts that status code and response headers are correct.
|
|
- name: verify_revision_created
|
|
desc: Verify that revision was created for document above
|
|
GET: /api/v1.0/revisions/$RESPONSE['$.[0].status.revision']
|
|
status: 200
|
|
response_multidoc_jsonpaths:
|
|
$.[0].id: $HISTORY['initialize'].$RESPONSE['$.[0].status.revision']
|
|
$.[0].buckets: [mop]
|
|
$.[0].tags: {}
|
|
|
|
# Validates whether revision was created.
|
|
# Asserts that status code and response headers are correct.
|
|
- name: verify_revision_list
|
|
desc: Verify that revision was created for document above
|
|
GET: /api/v1.0/revisions
|
|
status: 200
|
|
response_multidoc_jsonpaths:
|
|
$.[0].count: 1
|
|
$.[0].results[0].id: $HISTORY['initialize'].$RESPONSE['$.[0].status.revision']
|
|
$.[0].results[0].buckets: [mop]
|
|
$.[0].results[0].tags: []
|
|
|
|
# Validates whether revision deletion works.
|
|
# Required parameters:
|
|
# path: revision_id.
|
|
- name: purge_created_revision
|
|
desc: Begin testing from known state.
|
|
DELETE: /api/v1.0/revisions
|
|
status: 204
|
|
|
|
# Validates whether revision was deleted.
|
|
# Required parameters:
|
|
# path: revision_id.
|
|
# Asserts that 404 is thrown when trying to retrieve deleted revision.
|
|
- name: verify_revision_deleted
|
|
desc: Verify that the revision was deleted
|
|
GET: /api/v1.0/revisions/$HISTORY['initialize'].$RESPONSE['$.[0].status.revision']
|
|
status: 404
|