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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c1e860624b2f137cc108dcd249bd331cd4f60d00
4
- data.tar.gz: 1c008f553cab40650323a232adff99cd2bf0a15f
3
+ metadata.gz: 1ce0b182bfe8a7288c6ff505121a839136cad56c
4
+ data.tar.gz: accc15fbe528c93dd54324f3e493f61594e11351
5
5
  SHA512:
6
- metadata.gz: 3c0fa7a1ca5c945a1222624b7881ea9255cd49c58496e6ffd7434627e46a8f92ff469f5199175965e97fa5c746eeb0806a389e2d2884149d2ea90ae6b6c1ea8f
7
- data.tar.gz: f86e53286e61a65f36b3c2735cd16d31debfe056798928df1fc002e4bb85c1e049346b0ca7ce46c46f382372c520c2a42764285413a4afe56fd05959d03c1fca
6
+ metadata.gz: 1fd256410a908636dfd4d4e9d48277cdb1aa472cba77b3a541ec59af17be3abcaf3d3bbf29acc3b39ef59ec5ae0dfe86d6e5d538af9e14a5fe450677b912a971
7
+ data.tar.gz: 5be1ff9e0c34d7ab2ee1441cdc6a961c2b4982ea3ddde67cb336bdd2620420924a9106c4e35d1d586051491f100541a91c41ef0bd35764f263e2201063eaacb3
@@ -1,5 +1,5 @@
1
1
  module RSpecApi
2
2
  module Requests
3
- VERSION = '0.7.1'
3
+ VERSION = '0.7.2'
4
4
  end
5
5
  end
@@ -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
- extra_requests(request_params).map do |extra_request|
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 extra_requests(params = {})
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.blank?}.tap do |expectations|
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.1
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-26 00:00:00.000000000 Z
11
+ date: 2013-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec