rspec-api-requests 0.7.1 → 0.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rspec-api/requests/version.rb +1 -1
- data/lib/rspec-api/respond_with.rb +2 -2
- data/lib/rspec-api/respond_with/request.rb +2 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 1ce0b182bfe8a7288c6ff505121a839136cad56c
|
4
|
+
data.tar.gz: accc15fbe528c93dd54324f3e493f61594e11351
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1fd256410a908636dfd4d4e9d48277cdb1aa472cba77b3a541ec59af17be3abcaf3d3bbf29acc3b39ef59ec5ae0dfe86d6e5d538af9e14a5fe450677b912a971
|
7
|
+
data.tar.gz: 5be1ff9e0c34d7ab2ee1441cdc6a961c2b4982ea3ddde67cb336bdd2620420924a9106c4e35d1d586051491f100541a91c41ef0bd35764f263e2201063eaacb3
|
@@ -12,7 +12,7 @@ module RSpecApi
|
|
12
12
|
request_params = build_request_params
|
13
13
|
result = request status, request_params, values, &block
|
14
14
|
|
15
|
-
|
15
|
+
other_requests(request_params).map do |extra_request|
|
16
16
|
body = values.merge extra_request.fetch(:params, {})
|
17
17
|
params = request_params.merge extra_request.fetch(:expect, {})
|
18
18
|
result = [*result] << request(status, params, body, &block)
|
@@ -30,7 +30,7 @@ module RSpecApi
|
|
30
30
|
end
|
31
31
|
end
|
32
32
|
|
33
|
-
def
|
33
|
+
def other_requests(params = {})
|
34
34
|
if valid?(params) && params[:collection]
|
35
35
|
params.fetch :extra_requests, {}
|
36
36
|
else
|
@@ -33,8 +33,9 @@ module RSpecApi
|
|
33
33
|
|
34
34
|
def expectations_for(status, params)
|
35
35
|
keys = [:collection, :attributes, :sort, :filter, :page_links, :callback]
|
36
|
-
params.slice(*keys).delete_if{|k, v| v.
|
36
|
+
params.slice(*keys).delete_if{|k, v| v.nil?}.tap do |expectations|
|
37
37
|
expectations[:status] = status
|
38
|
+
expectations[:type] = :json
|
38
39
|
end
|
39
40
|
end
|
40
41
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rspec-api-requests
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.7.
|
4
|
+
version: 0.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- claudiob
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-12-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rspec
|