open_api-rspec 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/.reek.yml +2 -1
- data/Gemfile.lock +2 -2
- data/lib/open_api/rspec/shared_examples.rb +2 -25
- data/lib/open_api/rspec/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: eae22068105e1aac1b31e6dc0efe2e98c00cf686e74b38c0f9d100338e150e0d
|
4
|
+
data.tar.gz: 1b718583684a6ffd8f713656555da193c02b7ec1673febf44a31576232dd1708
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5469708795938a8458b787768f637630805abbbfc81ede6009cdb8f35da71eaeb7651e4cd1e2db813a3fedc1b3cd840b50902262ebcd296e862e3c563d569e5d
|
7
|
+
data.tar.gz: c29ae21d4a3e9feff6e35cd3e17aa96f25b268c6855cd4d53c6d7ae0448f5a0aa9ae403aff867c766a45ef34d61daeb1aa60f1786e018653e913dfb67073340c
|
data/.reek.yml
CHANGED
@@ -12,10 +12,11 @@ detectors:
|
|
12
12
|
exclude:
|
13
13
|
- OpenApi::RSpec::SchemaParser#deep_body_keys
|
14
14
|
- OpenApi::RSpec::SchemaParser#get_deep_keys
|
15
|
+
- OpenApi::RSpec::SchemaParser#openapi_body_params
|
16
|
+
- OpenApi::RSpec::SchemaParser#openapi_form_data_params
|
15
17
|
- OpenApi::RSpec::SchemaParser#openapi_required_form_data_params
|
16
18
|
- OpenApi::RSpec::SchemaParser#openapi_required_path_params
|
17
19
|
- OpenApi::RSpec::SchemaParser#openapi_required_query_string_params
|
18
|
-
- OpenApi::RSpec::SchemaParser#openapi_form_data_params
|
19
20
|
NestedIterators:
|
20
21
|
exclude:
|
21
22
|
- OpenApi::RSpec::SchemaParser#deep_body_keys
|
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
open_api-rspec (0.1.
|
4
|
+
open_api-rspec (0.1.9)
|
5
5
|
activesupport
|
6
6
|
open_api-schema_validator (>= 0.1.1)
|
7
7
|
rspec
|
@@ -27,7 +27,7 @@ GEM
|
|
27
27
|
i18n (>= 0.7, < 2)
|
28
28
|
minitest (~> 5.1)
|
29
29
|
tzinfo (~> 1.1)
|
30
|
-
addressable (2.
|
30
|
+
addressable (2.6.0)
|
31
31
|
public_suffix (>= 2.0.2, < 4.0)
|
32
32
|
ast (2.4.0)
|
33
33
|
axiom-types (0.1.1)
|
@@ -7,72 +7,49 @@ module OpenApi
|
|
7
7
|
let(:schema_hash) { ::JSON.parse(open_api_json) }
|
8
8
|
let(:schema_parser) { OpenApi::RSpec::SchemaParser.new(schema_hash, request, response) }
|
9
9
|
|
10
|
-
it '
|
10
|
+
it 'matches the swagger.json for the request' do
|
11
11
|
expect(schema_parser.schema_for_url).not_to(
|
12
12
|
be_nil,
|
13
|
-
'url not documented'
|
13
|
+
'url not documented in swagger.json'
|
14
14
|
)
|
15
|
-
end
|
16
|
-
|
17
|
-
it 'matches an allowed http request method' do
|
18
15
|
expect(schema_parser.schema_for_url_and_request_method).not_to(
|
19
16
|
be_nil,
|
20
17
|
'http method for url not documented'
|
21
18
|
)
|
22
|
-
end
|
23
|
-
|
24
|
-
it 'has all required request query parameters' do
|
25
19
|
schema_parser.openapi_required_query_string_params.each do |openapi_param|
|
26
20
|
expect(schema_parser.request_params).to(
|
27
21
|
include(openapi_param),
|
28
22
|
'missing required request query parameters'
|
29
23
|
)
|
30
24
|
end
|
31
|
-
end
|
32
|
-
|
33
|
-
it 'has all required request path parameters' do
|
34
25
|
schema_parser.openapi_required_path_params.each do |openapi_param|
|
35
26
|
expect(schema_parser.request_path_params).to(
|
36
27
|
include(openapi_param),
|
37
28
|
'missing required request path parameters'
|
38
29
|
)
|
39
30
|
end
|
40
|
-
end
|
41
|
-
|
42
|
-
it 'has all required request form data parameters' do
|
43
31
|
schema_parser.openapi_required_form_data_params.each do |openapi_param|
|
44
32
|
expect(schema_parser.request_params).to(
|
45
33
|
include(openapi_param),
|
46
34
|
'missing required request form data parameters'
|
47
35
|
)
|
48
36
|
end
|
49
|
-
end
|
50
|
-
|
51
|
-
it 'does not allow undocumented request path parameters' do
|
52
37
|
schema_parser.request_path_params.each do |request_param|
|
53
38
|
expect(schema_parser.openapi_path_params).to(
|
54
39
|
include(request_param),
|
55
40
|
"#{request_param} is an undocumented request path parameter"
|
56
41
|
)
|
57
42
|
end
|
58
|
-
end
|
59
|
-
|
60
|
-
it 'does not allow undocumented request parameters' do
|
61
43
|
schema_parser.request_params.each do |request_param|
|
62
44
|
expect(schema_parser.openapi_request_params).to(
|
63
45
|
include(request_param),
|
64
46
|
"#{request_param} is an undocumented request parameter"
|
65
47
|
)
|
66
48
|
end
|
67
|
-
end
|
68
|
-
|
69
|
-
it 'matches an allowed http response status' do
|
70
49
|
expect(schema_parser.schema_for_url_and_request_method_and_response_status).not_to(
|
71
50
|
be_nil,
|
72
51
|
'http response status not documented'
|
73
52
|
)
|
74
|
-
end
|
75
|
-
it 'matches the response schema' do
|
76
53
|
response_schema = schema_parser.schema_for_url_and_request_method_and_response_status
|
77
54
|
results = if response_schema['schema']
|
78
55
|
::OpenApi::SchemaValidator.validate_schema!(
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: open_api-rspec
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryan Hansen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-02-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|