Skip to content

Commit 363dd41

Browse files
committed
NRL-476 add success update test
1 parent bbe406c commit 363dd41

File tree

2 files changed

+42
-1
lines changed

2 files changed

+42
-1
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,44 @@
11
# Update Document Reference
22
# Update Document Reference urlencoded
33
# Update Document Reference - multiple changes
4+
Feature: Producer - updateDocumentReference - Success Scenarios
5+
6+
Scenario: Successfully Update a DocumentReference
7+
Given the application 'DataShare' (ID 'z00z-y11y-x22x') is registered to access the API
8+
And the organisation 'X26' is authorised to access pointer types:
9+
| system | value |
10+
| http://snomed.info/sct | 1363501000000100 |
11+
| http://snomed.info/sct | 736253002 |
12+
And a DocumentReference resource exists with values:
13+
| property | value |
14+
| id | X26-1114567892-updateDocTest |
15+
| subject | 9999999999 |
16+
| status | current |
17+
| type | 736253002 |
18+
| category | 734163000 |
19+
| contentType | application/pdf |
20+
| url | https://example.org/my-doc.pdf |
21+
| custodian | X26 |
22+
| author | X26 |
23+
When producer 'X26' updates a DocumentReference 'X26-1114567892-updateDocTest' with values:
24+
| property | value |
25+
| docStatus | entered-in-error |
26+
Then the response status code is 200
27+
And the response is an OperationOutcome with 1 issue
28+
And the OperationOutcome contains the issue:
29+
"""
30+
{
31+
"severity": "information",
32+
"code": "informational",
33+
"details": {
34+
"coding": [
35+
{
36+
"system": "https://fhir.nhs.uk/ValueSet/NRL-ResponseCode",
37+
"code": "RESOURCE_UPDATED",
38+
"display": "Resource updated"
39+
}
40+
]
41+
},
42+
"diagnostics": "The DocumentReference has been updated"
43+
}
44+
"""

tests/features/steps/2_request.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ def update_put_document_reference_step(
148148

149149
context.response = client.update(doc_ref, doc_ref_id)
150150

151-
if context.response.status_code == 201:
151+
if context.response.status_code == 200:
152152
context.add_cleanup(lambda: context.repository.delete_by_id(doc_ref_id))
153153

154154

0 commit comments

Comments
 (0)