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 +4 -4
- data/CHANGELOG.txt +4 -0
- data/lib/reqres_rspec/collector.rb +12 -7
- data/lib/reqres_rspec/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1d8995d0e0ff6042385423b1fad999958bdc7f82
|
4
|
+
data.tar.gz: 7b5aef7c3a3c37a8e6d119d4565aab7325da0589
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: edab13663fe8a9f512a9ee200b9bccf4193dd910eb67af3bf3cd4bbf57c09ec6a73e97e9b9eb3a60cab09cf897190b193970b1c80b1ef810659f33de506aad13
|
7
|
+
data.tar.gz: f89388aad3c79572adf8bfa13197b89785ee09c1d86b993597134675d680358f3796ef9c61ce92d5057705ac65c4e65233b359227f4d6007649acf51dfe55472
|
data/CHANGELOG.txt
CHANGED
@@ -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
|
-
|
208
|
-
|
209
|
-
|
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
|
data/lib/reqres_rspec/version.rb
CHANGED