Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fi 3007 - subscription validation #5

Open
wants to merge 6 commits into
base: main
Choose a base branch
from
Open
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,19 @@ class SubscriptionConformanceTest < Inferno::Test

output :updated_subscription, :subscription_topic

def valid_url?(url)
uri = URI.parse(url)
uri.is_a?(URI::HTTP) && !uri.host.nil?
rescue URI::InvalidURIError
false
end

run do
omit_if subscription_resource.blank?, 'Did not input a Subscription resource of this type.'
subscription = subscription_verification(subscription_resource)
no_error_verification('Subscription resource is not conformant.')

assert(subscription['criteria'].present?,
assert(subscription['criteria'].present? && valid_url?(subscription['criteria']),
'The `criteria` field SHALL be populated and contain the canonical URL for the Subscription Topic.')
output subscription_topic: subscription['criteria']
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like we no longer use output subscription_criteria anywhere, which means that:

  1. we can remove it
  2. we can move this URL check inside the subscription_verification method so that it gets run whenever subscriptions are verified. This also means you can add a test case or two to the spec test.


Expand Down
Loading