rspec-api_helpers 0.2.0 → 0.2.1

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: e39766df47a5e882fe90dabfe2fc4454891af1d6
4
- data.tar.gz: 40e50c76772eb224404b81fb6106468bd610823c
3
+ metadata.gz: b793c8e8f7f6b2ac576475bbd5a388770374a396
4
+ data.tar.gz: e9b24e1f7035dc2c255d807aa21b7d71f86ffb55
5
5
  SHA512:
6
- metadata.gz: 5a2376e96df8cd62d06b00ec44de1a70dc71139a9839c4f12b4488519aa572d6037e863b4bee42ad2ca5d06fa1c4350d6f88bf7be3ed83581fbf51b9ca2092b9
7
- data.tar.gz: bda8bd3912b2f9fdebfb5bdebe38a04538eeb0dde5e3c1edd4d0b82689fa3e1566a4f2c5dd41de50cb2906104da42b7760355bc0b55a4dc999e9b34e0b992793
6
+ metadata.gz: dbb94217c3cd0dd3d6218aa3a5905f2581ff6b6d1b53c1957660d3d1e872234a7ac9c0dbd75ddbfa8cd45d4789e3e6e5ac7947d21e0c06d3feed2f198eb576e2
7
+ data.tar.gz: 5b7de73e53c6bddacff741325324824ab2a2ea2254af2ad964006f0809f8e74e93b33799a6635fe14ca0a4eaacd335432155a9580703db51e166751358135ee8
@@ -80,6 +80,20 @@ module Rspec
80
80
  end
81
81
  end
82
82
 
83
+ def it_returns_collection_embedded_size(resource:, embeds:, size:)
84
+ it "returns the correct number of embedded resource #{embeds} in the #{resource} collection" do
85
+ resources = objectize_resources(last_response.body, root: resource)
86
+ expect(resources.sample[embeds].length).to eql(size)
87
+ end
88
+ end
89
+
90
+ def it_returns_embedded_size(resource:, embeds:, size:)
91
+ it "returns the correct number of embedded resource #{embeds} in the #{resource} resource" do
92
+ resource = objectize_resource(last_response.body, root: resource)
93
+ expect(resource.send(embeds).length).to eql(size)
94
+ end
95
+ end
96
+
83
97
  def it_returns_collection_attributes(resource:, attributes: [], subset: true)
84
98
  it "returns the correct attributes (no value checking) for each resource in the #{resource} collection" do
85
99
  resources = objectize_resources(last_response.body, root: resource.pluralize)
@@ -1,5 +1,5 @@
1
1
  module Rspec
2
2
  module Api
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rspec-api_helpers
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Filippos Vasilakis
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-10-09 00:00:00.000000000 Z
12
+ date: 2015-10-13 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler