open_api-rspec 0.1.8 → 0.1.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 5ed298d9b2b25b788f50c9afe8647df9d3f1ce39d258b3181888d7b7e9d7d6dc
4
- data.tar.gz: 9ecfd050ab603d6f036bc9e096a352b36e09e3a1de2434e0aefa42c00ee88621
3
+ metadata.gz: eae22068105e1aac1b31e6dc0efe2e98c00cf686e74b38c0f9d100338e150e0d
4
+ data.tar.gz: 1b718583684a6ffd8f713656555da193c02b7ec1673febf44a31576232dd1708
5
5
  SHA512:
6
- metadata.gz: e26da40f0f7c1bd424ecee6726c2359c67edbd2666c9e94bf685e0d5a9c79995656a6cce165bd22902a99b47b25330af5b63005ae9d72590f786c6ecd580800c
7
- data.tar.gz: 48b4172478a037172975796038025863d9ea4b64a311a2f903c9a6efea61d43d5285ef2ef4c299077cb1d063ba628d7dec2b60f73d6f16cdf34b32ea5814eb8e
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.8)
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.5.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 'has openapi documentation for url' do
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!(
@@ -2,6 +2,6 @@
2
2
 
3
3
  module OpenApi
4
4
  module RSpec
5
- VERSION = '0.1.8'
5
+ VERSION = '0.1.9'
6
6
  end
7
7
  end
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.8
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-01-08 00:00:00.000000000 Z
11
+ date: 2019-02-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler