contentful_model 1.2.0 → 1.3.0
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/lib/contentful_model/errors.rb +1 -0
- data/lib/contentful_model/queries.rb +4 -0
- data/lib/contentful_model/query.rb +4 -0
- data/lib/contentful_model/version.rb +1 -1
- data/spec/query_spec.rb +16 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 9698f899467e305668facbe2f839511aeeb471da81fb65b7d73c6328afe55c70
|
4
|
+
data.tar.gz: 91cc79dd66f213c21fbc63c25d537896c68ab27702295176e5f29b8fa55cc03e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 52e15d3939439beebbb265847d1493ce3d01bc96f67f62adc95403bd7f432bd5977702595233ac17c218dda6473fe16f943595ad610094152e0001c5db5e5225
|
7
|
+
data.tar.gz: 783982e1384ff5f304a2bdce4cedafc1068e04ca72caeeb58d382180e1b1e66a823689cdbc9373f33b73158fece47030cda336b29cf4f7435d333ddbeffa9f12
|
data/spec/query_spec.rb
CHANGED
@@ -93,6 +93,22 @@ describe ContentfulModel::Query do
|
|
93
93
|
end
|
94
94
|
end
|
95
95
|
|
96
|
+
describe '#load!' do
|
97
|
+
it 'raises an error when response is empty' do
|
98
|
+
vcr('query/empty') {
|
99
|
+
expect { subject.load! }.to raise_error ContentfulModel::NotFoundError
|
100
|
+
}
|
101
|
+
end
|
102
|
+
|
103
|
+
it 'returns items when response is not empty' do
|
104
|
+
query = described_class.new(Cat, 'sys.id' => 'nyancat')
|
105
|
+
vcr('nyancat') {
|
106
|
+
entries = query.load!
|
107
|
+
expect(entries.first.id).to eq 'nyancat'
|
108
|
+
}
|
109
|
+
end
|
110
|
+
end
|
111
|
+
|
96
112
|
describe '#discover_includes' do
|
97
113
|
it 'defaults to 1 for a class without associations' do
|
98
114
|
query = described_class.new(Cat)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contentful_model
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Contentful GmbH (David Litvak Bruno)
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2020-01-02 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: contentful
|