rspec-document_requests 1.3.1 → 1.3.2
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/Gemfile +6 -0
- data/README.md +4 -2
- data/lib/rspec/document_requests/configuration.rb +2 -2
- data/lib/rspec/document_requests/dsl.rb +12 -2
- data/lib/rspec/document_requests/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: de229a50116f4c39157c491227820d86170e701e
|
4
|
+
data.tar.gz: 2c481ab74dc8214538cac36f11f0eb4faa35c010
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9e926f900d0c4730e66621ed3fdb0e1fd6244046619e9e7b521ffd1850ff98e434cfc73456bb0b8fcf90858b17e484ed37d5a9018ae7502dcf6f7215ffbd0f96
|
7
|
+
data.tar.gz: cf91e30efdb92ebb494f1c93fa2a8f1c865e93a04ba90ef101b59fb4a7d9c152a90a3cbfdda3e43540433f552e5a576deb66b8a1dd4b8d428939b8f65a986154
|
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -281,8 +281,10 @@ end
|
|
281
281
|
|
282
282
|
## Development
|
283
283
|
|
284
|
-
|
285
|
-
|
284
|
+
1. Pick an Active Record version to develop against, then export it: `export AR=4.2.6`.
|
285
|
+
2. Run `bin/setup` to install dependencies.
|
286
|
+
3. Run `rspec` to run the specs.
|
287
|
+
|
286
288
|
|
287
289
|
## Contributing
|
288
290
|
|
@@ -14,8 +14,8 @@ module RSpec
|
|
14
14
|
add_property :writer, Writers::Markdown
|
15
15
|
add_property :filename_generator, -> (name) { name.downcase.gsub(/[_ ]+/, '-') }
|
16
16
|
add_property :response_parser, -> (response) {
|
17
|
-
case
|
18
|
-
when
|
17
|
+
case response.content_type
|
18
|
+
when 'application/json' then JSON.parse(response.body)
|
19
19
|
end
|
20
20
|
}
|
21
21
|
|
@@ -7,8 +7,18 @@ module RSpec
|
|
7
7
|
self.documented_requests = []
|
8
8
|
|
9
9
|
[:get, :post, :patch, :put, :delete, :head].each do |method|
|
10
|
-
define_method(method) do |path,
|
11
|
-
result = super(path,
|
10
|
+
define_method(method) do |path, *args|
|
11
|
+
result = super(path, *args)
|
12
|
+
|
13
|
+
if ActionPack::VERSION::MAJOR < 5
|
14
|
+
# old signature (https://github.com/rails/rails/blob/v4.2.7.1/actionpack/lib/action_dispatch/testing/integration.rb#L265)
|
15
|
+
# def process(method, path, parameters = nil, headers_or_env = nil)
|
16
|
+
parameters = args[0]
|
17
|
+
else
|
18
|
+
# new signature (https://github.com/rails/rails/blob/master/actionpack/lib/action_dispatch/testing/integration.rb#L204)
|
19
|
+
# def process(method, path, params: nil, headers: nil, env: nil, xhr: false, as: nil)
|
20
|
+
parameters = (args[0] || {})[:params]
|
21
|
+
end
|
12
22
|
|
13
23
|
if not @document_requests_prevented and @currently_documented_example
|
14
24
|
DSL.documented_requests << Request.new(
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-document_requests
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.3.
|
4
|
+
version: 1.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Oded Niv
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2016-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec-rails
|
@@ -101,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
101
101
|
version: '0'
|
102
102
|
requirements: []
|
103
103
|
rubyforge_project:
|
104
|
-
rubygems_version: 2.
|
104
|
+
rubygems_version: 2.5.1
|
105
105
|
signing_key:
|
106
106
|
specification_version: 4
|
107
107
|
summary: Automatically documents requests generated by RSpec examples.
|