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 +4 -4
- data/lib/rspec/api_helpers/example_group_methods.rb +14 -0
- data/lib/rspec/api_helpers/version.rb +1 -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: b793c8e8f7f6b2ac576475bbd5a388770374a396
|
4
|
+
data.tar.gz: e9b24e1f7035dc2c255d807aa21b7d71f86ffb55
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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)
|
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.
|
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-
|
12
|
+
date: 2015-10-13 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|