reqres_rspec 0.1.19 → 0.1.20

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
  SHA1:
3
- metadata.gz: 946bfb3df21ca26a5ba285e9b0dcdf8ecaaf011a
4
- data.tar.gz: 2e011b2e33e8659f0bf196d90c70147452b5d13d
3
+ metadata.gz: 1d8995d0e0ff6042385423b1fad999958bdc7f82
4
+ data.tar.gz: 7b5aef7c3a3c37a8e6d119d4565aab7325da0589
5
5
  SHA512:
6
- metadata.gz: 50eac4c000e5259c586f315ccb77de7dfcde400d19dec32117560bc3b2ae216ff18fea2be8b83998b8765c5d812c2665aee35d233382e3a505daa5c63361c697
7
- data.tar.gz: 4d1eda41078af7fbf18c3944a8eb45324bf469da48e4842e1f42d8d4083619ef6aad981318c15713d458db3302dea4a7bff1db7dd61707249b92431bb6ab99aa
6
+ metadata.gz: edab13663fe8a9f512a9ee200b9bccf4193dd910eb67af3bf3cd4bbf57c09ec6a73e97e9b9eb3a60cab09cf897190b193970b1c80b1ef810659f33de506aad13
7
+ data.tar.gz: f89388aad3c79572adf8bfa13197b89785ee09c1d86b993597134675d680358f3796ef9c61ce92d5057705ac65c4e65233b359227f4d6007649acf51dfe55472
data/CHANGELOG.txt CHANGED
@@ -1,3 +1,7 @@
1
+ version 0.1.20
2
+
3
+ improve params cleanup
4
+
1
5
  version 0.1.19
2
6
 
3
7
  fix skipping "warden" and "devise.mapping" request headers
@@ -25,6 +25,8 @@ module ReqresRspec
25
25
  X-Runtime
26
26
  X-UA-Compatible
27
27
  X-XSS-Protection
28
+ Vary
29
+ Last-Modified
28
30
  ]
29
31
 
30
32
  # request headers contain many unnecessary information,
@@ -94,7 +96,7 @@ module ReqresRspec
94
96
  request: {
95
97
  host: request.host,
96
98
  url: request.url,
97
- path: request.path,
99
+ path: request.path.to_s.gsub('%2F', '/'),
98
100
  symbolized_path: get_symbolized_path(request),
99
101
  method: request.request_method,
100
102
  query_parameters: query_parameters,
@@ -149,7 +151,8 @@ module ReqresRspec
149
151
  private
150
152
 
151
153
  def example_title(spec, example)
152
- spec.class.metadata[:reqres_title] || example.metadata[:reqres_title] || spec.class.example.full_description
154
+ t = spec.class.metadata[:reqres_title] || example.metadata[:reqres_title] || spec.class.example.full_description
155
+ t.strip
153
156
  end
154
157
 
155
158
  # read and cleanup response headers
@@ -197,16 +200,18 @@ module ReqresRspec
197
200
  # symbolized path => /api/users/:id
198
201
  #
199
202
  def get_symbolized_path(request)
200
- request_path = request.path
203
+ request_path = request.env['REQUEST_URI'] || request.path
201
204
  request_params =
202
205
  request.env['action_dispatch.request.parameters'] ||
203
206
  request.env['rack.request.form_hash'] ||
204
207
  request.env['rack.request.query_hash']
205
208
 
206
- request_params
207
- .except(*EXCLUDE_PARAMS)
208
- .select { |_, value| value.is_a?(String) }
209
- .each { |key, value| request_path.sub!("/#{value}", "/:#{key}") }
209
+ if request_params
210
+ request_params
211
+ .except(*EXCLUDE_PARAMS)
212
+ .select { |_, value| value.is_a?(String) }
213
+ .each { |key, value| request_path.sub!("/#{value}", "/:#{key}") if value.to_s != '' }
214
+ end
210
215
 
211
216
  request_path
212
217
  end
@@ -1,3 +1,3 @@
1
1
  module ReqresRspec
2
- VERSION = '0.1.19'
2
+ VERSION = '0.1.20'
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.1.19
4
+ version: 0.1.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - rilian