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

71 structure json schema files #72

Merged
merged 5 commits into from
Mar 3, 2017
Merged

Conversation

eugenk
Copy link
Member

@eugenk eugenk commented Feb 2, 2017

This shall fix #71.

It makes the structure also compatible with doca (see #61).

# 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))

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|

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') }

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') }

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]

@@ -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".
Copy link
Member

Choose a reason for hiding this comment

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

Do you mean transforms?

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed by commit amend.

@eugenk eugenk force-pushed the 71-structure_json_schema_files branch from dba068d to 591c5b4 Compare February 20, 2017 13:37
Copy link
Member

@ebolloff ebolloff left a comment

Choose a reason for hiding this comment

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

@eugenk eugenk merged commit a3535df into master Mar 3, 2017
@eugenk eugenk deleted the 71-structure_json_schema_files branch March 3, 2017 11:38
@eugenk eugenk removed the in progress label Mar 3, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Structure json schema files
3 participants