reqres_rspec 0.0.5 → 0.0.6

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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d2dac284279b7dd4e194485c094b6ef33287fcfd
4
- data.tar.gz: 68c90e2f6bdb662a9102119840eed3a7f2aa3808
3
+ metadata.gz: 937b17f50f1dc30d5bbc2e26434c1738112e4506
4
+ data.tar.gz: 212c2b265ce056ad27e795dc0c8c889bf0f75aa4
5
5
  SHA512:
6
- metadata.gz: a78310460a2b679adefefc8dcae5853e1bfd73ab5cfa4cb2f73ab7f5500d16f0309bdaca4a01f00de144707ae28daf17a3a3f7a92056e9a462ad02d5b36151c5
7
- data.tar.gz: 7bc542dce81126cfc49958443b3f813446173d9e3759aeb13b6fe20887e0ff6b4ca5e5062eba7cbea037fca4a1514c75f396f5302b46d526a311b77cf9548b69
6
+ metadata.gz: 498727029441cdef742921c0d3a0242d864103d072613b922abfd6543d771ad5818668496f5a8fc68c8de2d5d86687d45ba04ee7859c5c460ac8d34918818020
7
+ data.tar.gz: 5ff0749a160bb2ec2cf6ea954cb22d1ebad9530129ab11482470fa764f2a47d2d90ef68a7754e955b7a77b1469a4bcf93e8422774df063372cf2b92238108896
@@ -36,18 +36,29 @@ module ReqresRspec
36
36
 
37
37
  # collects spec data for further processing
38
38
  def collect(spec, request, response)
39
+ description = query_parameters = backend_parameters = 'not available'
40
+ params = []
41
+ if request.env && (request_params = request.env['action_dispatch.request.parameters'])
42
+ if request_params['controller'] && request_params['action']
43
+ description = get_action_description(request_params['controller'], request_params['action'])
44
+ params = get_action_params(request_params['controller'], request_params['action'])
45
+ query_parameters = request_params.reject { |p| %w[controller action].include? p }
46
+ backend_parameters = request_params.reject { |p| !%w[controller action].include? p }
47
+ end
48
+ end
49
+
39
50
  self.records << {
40
51
  title: spec.example.full_description,
41
- description: get_action_description(request.env['action_dispatch.request.parameters']['controller'], request.env['action_dispatch.request.parameters']['action']),
42
- params: get_action_params(request.env['action_dispatch.request.parameters']['controller'], request.env['action_dispatch.request.parameters']['action']),
52
+ description: description,
53
+ params: params,
43
54
  request_path: get_symbolized_path(request),
44
55
  request: {
45
56
  host: request.host,
46
57
  url: request.url,
47
58
  path: request.path,
48
59
  method: request.request_method,
49
- query_parameters: request.env['action_dispatch.request.parameters'].reject { |p| %w[controller action].include? p },
50
- backend_parameters: request.env['action_dispatch.request.parameters'].reject { |p| !%w[controller action].include? p },
60
+ query_parameters: query_parameters,
61
+ backend_parameters: backend_parameters,
51
62
  body: request.body.read,
52
63
  content_length: request.content_length,
53
64
  content_type: request.content_type,
@@ -1,3 +1,3 @@
1
1
  module ReqresRspec
2
- VERSION = '0.0.5'
2
+ VERSION = '0.0.6'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reqres_rspec
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - rilian