Class: Crucible::Tests::ConnectathonPatchTrackTest

Inherits:
BaseSuite show all
Defined in:
lib/tests/suites/connectathon_patch_track.rb

Constant Summary

Constants inherited from BaseSuite

BaseSuite::EXCLUDED_RESOURCES

Constants inherited from BaseTest

BaseTest::BASE_SPEC_LINK, BaseTest::JSON_FIELDS, BaseTest::METADATA_FIELDS, BaseTest::REST_SPEC_LINK, BaseTest::STATUS

Instance Attribute Summary

Attributes inherited from BaseTest

#category, #tags, #tests_subset, #warnings

Instance Method Summary collapse

Methods inherited from BaseSuite

#build_messages, #collect_metadata, fhir_resources, #links, #metadata, #parse_operation_outcome, #requires, #resource_category, test, #title, #validates

Methods inherited from BaseTest

#author, #details, #execute, #execute_test_method, #execute_test_methods, #ignore_client_exception, #multiserver, #requires_authorization, #tests, #warning

Methods included from Assertions

#assert, #assert_bundle_entry_count, #assert_bundle_response, #assert_bundle_transactions_okay, #assert_equal, #assert_etag_present, #assert_last_modified_present, #assert_minimum, #assert_navigation_links, #assert_operator, #assert_resource_content_type, #assert_resource_type, #assert_response_bad, #assert_response_code, #assert_response_conflict, #assert_response_created, #assert_response_gone, #assert_response_not_found, #assert_response_ok, #assert_valid_content_location_present, #assert_valid_profile, #assert_valid_resource_content_type_present, #assertion_negated, #skip

Constructor Details

#initialize(client1, client2 = nil) ⇒ ConnectathonPatchTrackTest

Returns a new instance of ConnectathonPatchTrackTest.



13
14
15
16
17
# File 'lib/tests/suites/connectathon_patch_track.rb', line 13

def initialize(client1, client2=nil)
  super(client1, client2)
  @tags.append('connectathon')
  @category = {id: 'connectathon', title: 'Connectathon'}
end

Instance Method Details

#descriptionObject



9
10
11
# File 'lib/tests/suites/connectathon_patch_track.rb', line 9

def description
  'Connectathon PATCH Test.'
end

#idObject



5
6
7
# File 'lib/tests/suites/connectathon_patch_track.rb', line 5

def id
  'ConnectathonPatchTrackTest'
end

#resource_format(f) ⇒ Object



119
120
121
# File 'lib/tests/suites/connectathon_patch_track.rb', line 119

def resource_format(f)
  "FHIR::Formats::ResourceFormat::RESOURCE_#{f}".constantize
end

#setupObject



19
20
21
22
23
24
25
26
27
28
# File 'lib/tests/suites/connectathon_patch_track.rb', line 19

def setup
  @medication_order = Crucible::Generator::Resources.new.medicationorder_simple
  @medication_order.id = nil # clear the identifier, in case the server checks for duplicates
  @medication_order.identifier = nil # clear the identifier, in case the server checks for duplicates

  reply = @client.create(@medication_order)

  assert_response_ok(reply)
  @medication_order_id = reply.id
end

#teardownObject



30
31
32
# File 'lib/tests/suites/connectathon_patch_track.rb', line 30

def teardown
  @client.destroy(FHIR::MedicationRequest, @medication_order_id) unless @medication_order_id.nil?
end