rspec-request_describer 0.3.0 → 0.3.1
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/CHANGELOG.md +4 -0
- data/lib/rspec/request_describer.rb +1 -1
- data/lib/rspec/request_describer/version.rb +1 -1
- data/spec/rspec/request_describer_spec.rb +19 -0
- 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: 56cff985b6ca3e943ccf4eeb4e22442645cc39ff587e0ea91fe384274d6b9a30
|
4
|
+
data.tar.gz: 2597ebc166da6f35b692e7faddd46b83a8a064ac6d9a2d452507d47f96edad81
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 79ee62dd7454fbd56c51c2b7ebbc39677c57228c1edc6943e3ceccc46f30f539d1a7165458a01a84270dee8ec07039ecc682a12ae5e9a5d827720714580cc72c
|
7
|
+
data.tar.gz: dc22b1bf82374f5fddbc78655b7838ae064cf9155f2794929753e2c8e6cb039f81b02f06bda9e33abc653aae6428a8f0479bde3639736633cfb87deff616e8da
|
data/CHANGELOG.md
CHANGED
@@ -5,6 +5,10 @@ All notable changes to this project will be documented in this file.
|
|
5
5
|
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
6
6
|
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
7
7
|
|
8
|
+
## v0.3.1 - 2019-05-08
|
9
|
+
|
10
|
+
- Fix env calculation timing.
|
11
|
+
|
8
12
|
## v0.3.0 - 2019-05-05
|
9
13
|
|
10
14
|
### Added
|
@@ -33,7 +33,7 @@ module RSpec
|
|
33
33
|
end
|
34
34
|
|
35
35
|
let(:request_body) do
|
36
|
-
if
|
36
|
+
if headers.any? { |key, value| key.to_s.casecmp('content-type').zero? && value == 'application/json' }
|
37
37
|
params.to_json
|
38
38
|
else
|
39
39
|
params.inject({}) do |result, (key, value)|
|
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'openssl'
|
2
|
+
|
1
3
|
RSpec.describe RSpec::RequestDescriber do
|
2
4
|
include RSpec::RequestDescriber
|
3
5
|
|
@@ -68,6 +70,23 @@ RSpec.describe RSpec::RequestDescriber do
|
|
68
70
|
end
|
69
71
|
end
|
70
72
|
|
73
|
+
context 'with headers including request body' do
|
74
|
+
before do
|
75
|
+
headers['X-Signature'] = "sha1=#{OpenSSL::HMAC.hexdigest('SHA1', 'secret', request_body.to_s)}"
|
76
|
+
end
|
77
|
+
|
78
|
+
it 'calls #get with HTTP_ prefixed and stringified keys headers' do
|
79
|
+
is_expected.to eq(
|
80
|
+
[
|
81
|
+
:get,
|
82
|
+
'/users',
|
83
|
+
headers: { 'HTTP_X_SIGNATURE' => 'sha1=5d61605c3feea9799210ddcb71307d4ba264225f' },
|
84
|
+
params: {}
|
85
|
+
]
|
86
|
+
)
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
71
90
|
context 'with params' do
|
72
91
|
let(:params) do
|
73
92
|
super().merge('sort' => 'id')
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-request_describer
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ryo Nakamura
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-05-
|
11
|
+
date: 2019-05-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: actionpack
|