Module: DaVinciDTRTestKit::ReadTest
- Included in:
- CommunicationRequestReadTest, CoverageReadTest, DeviceRequestReadTest, EncounterReadTest, FhirContextCoverageTest, FhirContextReferencesTest, MedicationRequestReadTest, NutritionOrderReadTest, ServiceRequestReadTest, TaskReadTest, VisionPrescriptionReadTest
- Defined in:
- lib/davinci_dtr_test_kit/read_test.rb
Instance Method Summary collapse
- #all_scratch_resources ⇒ Object
- #bad_resource_id_message(expected_id) ⇒ Object
- #perform_read_test(resource_ids, resource_type) ⇒ Object
Instance Method Details
#all_scratch_resources ⇒ Object
3 4 5 |
# File 'lib/davinci_dtr_test_kit/read_test.rb', line 3 def all_scratch_resources scratch_resources[:all] ||= [] end |
#bad_resource_id_message(expected_id) ⇒ Object
23 24 25 |
# File 'lib/davinci_dtr_test_kit/read_test.rb', line 23 def (expected_id) "Expected resource to have id: `#{expected_id.inspect}`, but found `#{resource.id.inspect}`" end |
#perform_read_test(resource_ids, resource_type) ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/davinci_dtr_test_kit/read_test.rb', line 7 def perform_read_test(resource_ids, resource_type) skip_if(resource_ids.nil?, "No `#{resource_type}` IDs provided, skipping test.") resources = [] resource_ids.each do |id| fhir_read resource_type, id assert_response_status(200) assert_resource_type(resource_type) assert resource.id.present? && resource.id == id, (id) resources.push(resource) end all_scratch_resources.concat(resources) resources end |