-
Notifications
You must be signed in to change notification settings - Fork 3
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
71 structure json schema files #72
Conversation
spec/support/json_schema_matcher.rb
Outdated
# finds the innermost context and transforms it from "GET show" to "get_show". | ||
def normalized_context(example) | ||
example_group = example.example_group | ||
while (!(example_group.description =~ /\A(get|put|post|patch|delete)\s+/i)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/NegatedWhile: Favor until over while for negative conditions.
Style/ParenthesesAroundCondition: Don't use parentheses around the condition of a while.
Style/RedundantParentheses: Don't use parentheses around an unary operation.
end | ||
it { expect(response).to have_http_status(:unauthorized) } | ||
it do |example| |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Style/IndentationConsistency: Inconsistent indentation detected.
it do | ||
expect(response).to match_response_schema('v2', 'organization_show') | ||
end | ||
it { |example| expect([example, response]).to comply_with_api('organizations/get_show') } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [97/80]
@@ -18,8 +18,7 @@ | |||
context 'successful' do | |||
before { get :show, params: {slug: subject.slug} } | |||
it { expect(response).to have_http_status(:ok) } | |||
it { expect(response).to match_response_schema('v2', 'jsonapi') } | |||
it { expect(response).to match_response_schema('v2', 'user_show') } | |||
it { |example| expect([example, response]).to comply_with_api('users/get_show') } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Metrics/LineLength: Line is too long. [89/80]
df4a747
to
dba068d
Compare
spec/support/json_schema_matcher.rb
Outdated
@@ -1,14 +1,56 @@ | |||
# frozen_string_literal: true | |||
|
|||
RSpec::Matchers. | |||
define :match_response_schema do |api_version, schema| | |||
# Finds and ransforms constant V2::UsersController to string "v2/users". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean transforms
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed by commit amend.
dba068d
to
591c5b4
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shall fix #71.
It makes the structure also compatible with doca (see #61).