Skip to content

Commit

Permalink
Skip rather than fail granular scopes test if granular scope is reque…
Browse files Browse the repository at this point in the history
…sted (#566)
  • Loading branch information
emichaud998 authored Sep 23, 2024
1 parent e5ef9e9 commit 73f7aac
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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?
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 73f7aac

Please sign in to comment.