From 73f7aacb41067936aacdaef8a4e80a924af3668d Mon Sep 17 00:00:00 2001 From: Emily Semple <59289146+emichaud998@users.noreply.github.com> Date: Mon, 23 Sep 2024 10:29:17 -0400 Subject: [PATCH] Skip rather than fail granular scopes test if granular scope is requested (#566) --- .../smart_granular_scope_selection_test.rb | 2 +- .../smart_granular_scope_selection_test_spec.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/onc_certification_g10_test_kit/smart_granular_scope_selection_test.rb b/lib/onc_certification_g10_test_kit/smart_granular_scope_selection_test.rb index 167504b6..908a0340 100644 --- a/lib/onc_certification_g10_test_kit/smart_granular_scope_selection_test.rb +++ b/lib/onc_certification_g10_test_kit/smart_granular_scope_selection_test.rb @@ -33,7 +33,7 @@ def granular_scope_regex(resource_type) "No resource-level scope was requested for #{resource_type}" granular_scope = requested_scopes.find { |scope| scope.match(granular_scope_regex(resource_type)) } - assert granular_scope.nil?, "Granular scope was requested: #{granular_scope}" + skip_if granular_scope.present?, "Granular scope was requested: #{granular_scope}" end assert received_scopes.present? diff --git a/spec/onc_certification_g10_test_kit/smart_granular_scope_selection_test_spec.rb b/spec/onc_certification_g10_test_kit/smart_granular_scope_selection_test_spec.rb index aa77b557..209fc220 100644 --- a/spec/onc_certification_g10_test_kit/smart_granular_scope_selection_test_spec.rb +++ b/spec/onc_certification_g10_test_kit/smart_granular_scope_selection_test_spec.rb @@ -44,13 +44,13 @@ def run(runnable, inputs = {}) expect(result.result_message).to match(/No resource-level scope was requested/) end - it 'fails if a granular scope is requested' do + it 'skips if a granular scope is requested' do scopes_with_granular = "#{requested_scopes} patient/Observation.rs?category=" \ 'http://terminology.hl7.org/CodeSystem/observation-category|survey' result = run(test, requested_scopes: scopes_with_granular, received_scopes:) - expect(result.result).to eq('fail') + expect(result.result).to eq('skip') expect(result.result_message).to match(/Granular scope was requested/) end