hoodoo 2.12.5 → 2.12.6
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/hoodoo/version.rb +2 -2
- data/spec/services/services/response_spec.rb +9 -9
- metadata +7 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: ef8db3ad23e93ddb58cfa9c5d41342cbab01f00ce55e57b37cd93748732da340
|
|
4
|
+
data.tar.gz: bead6ded0b48b1b7ed361b9ec07ae59cdb0a797342ad8f96bac3b000bfc2cbf3
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0ecf3d0a5c33119941526e9b04684f72ed12c96d351755fcaa773e8b4b14918bc5a55a57cd4411d592448f54b25d09546f249ba37b7fca50c26e2d341a2f02cd
|
|
7
|
+
data.tar.gz: 523010953e4d7d3a07036224158163bc43743a45afe1ce5c106102ff50e1ae251090d4c04b2b8f3faa741d14032e68479e484273aaf7021d6c428a67a707c666
|
data/lib/hoodoo/version.rb
CHANGED
|
@@ -12,11 +12,11 @@ module Hoodoo
|
|
|
12
12
|
# The Hoodoo gem version. If this changes, be sure to re-run
|
|
13
13
|
# <tt>bundle install</tt> or <tt>bundle update</tt>.
|
|
14
14
|
#
|
|
15
|
-
VERSION = '2.12.
|
|
15
|
+
VERSION = '2.12.6'
|
|
16
16
|
|
|
17
17
|
# The Hoodoo gem date. If this changes, be sure to re-run
|
|
18
18
|
# <tt>bundle install</tt> or <tt>bundle update</tt>.
|
|
19
19
|
#
|
|
20
|
-
DATE = '2020-
|
|
20
|
+
DATE = '2020-11-10'
|
|
21
21
|
|
|
22
22
|
end
|
|
@@ -160,7 +160,7 @@ describe Hoodoo::Services::Response do
|
|
|
160
160
|
expected = JSON.generate({})
|
|
161
161
|
expect(status).to eq(200)
|
|
162
162
|
expect(headers).to eq({'Content-Length' => expected.length.to_s})
|
|
163
|
-
expect(body
|
|
163
|
+
expect(body).to eq([expected])
|
|
164
164
|
end
|
|
165
165
|
|
|
166
166
|
it 'should return header data correctly' do
|
|
@@ -172,7 +172,7 @@ describe Hoodoo::Services::Response do
|
|
|
172
172
|
expected = JSON.generate({})
|
|
173
173
|
expect(status).to eq(200)
|
|
174
174
|
expect(headers).to eq({'X-Foo' => 'baz', 'X-Bar' => 'boo', 'Content-Length' => expected.length.to_s})
|
|
175
|
-
expect(body
|
|
175
|
+
expect(body).to eq([expected])
|
|
176
176
|
end
|
|
177
177
|
|
|
178
178
|
it 'should return error condition Rack data correctly' do
|
|
@@ -187,7 +187,7 @@ describe Hoodoo::Services::Response do
|
|
|
187
187
|
expected = JSON.generate(errors_hash)
|
|
188
188
|
expect(status).to eq(422) # From the first error we stored, not the second
|
|
189
189
|
expect(headers).to eq({'Content-Length' => expected.length.to_s})
|
|
190
|
-
expect(body
|
|
190
|
+
expect(body).to eq([expected])
|
|
191
191
|
end
|
|
192
192
|
|
|
193
193
|
it 'should return non-error condition Rack data correctly with a Hash body' do
|
|
@@ -199,7 +199,7 @@ describe Hoodoo::Services::Response do
|
|
|
199
199
|
expected = JSON.generate(response_hash)
|
|
200
200
|
expect(status).to eq(200) # From the first error we stored, not the second
|
|
201
201
|
expect(headers).to eq({'Content-Length' => expected.length.to_s})
|
|
202
|
-
expect(body
|
|
202
|
+
expect(body).to eq([expected])
|
|
203
203
|
end
|
|
204
204
|
|
|
205
205
|
it 'returns non-error condition Rack data correctly with an Array body' do
|
|
@@ -211,7 +211,7 @@ describe Hoodoo::Services::Response do
|
|
|
211
211
|
expected = JSON.generate({'_data' => response_array})
|
|
212
212
|
expect(status).to eq(200) # From the first error we stored, not the second
|
|
213
213
|
expect(headers).to eq({'Content-Length' => expected.length.to_s})
|
|
214
|
-
expect(body
|
|
214
|
+
expect(body).to eq([expected])
|
|
215
215
|
end
|
|
216
216
|
|
|
217
217
|
it 'returns non-error condition Rack data correctly with a dataset size' do
|
|
@@ -223,7 +223,7 @@ describe Hoodoo::Services::Response do
|
|
|
223
223
|
expected = JSON.generate( { '_data' => response_array, '_dataset_size' => response_array.count } )
|
|
224
224
|
expect( status ).to eq( 200 )
|
|
225
225
|
expect( headers ).to eq( { 'Content-Length' => expected.length.to_s } )
|
|
226
|
-
expect( body
|
|
226
|
+
expect( body ).to eq( [ expected ] )
|
|
227
227
|
end
|
|
228
228
|
|
|
229
229
|
it 'returns non-error condition Rack data correctly with an estimated dataset size' do
|
|
@@ -235,7 +235,7 @@ describe Hoodoo::Services::Response do
|
|
|
235
235
|
expected = JSON.generate( { '_data' => response_array, '_estimated_dataset_size' => response_array.count } )
|
|
236
236
|
expect( status ).to eq( 200 )
|
|
237
237
|
expect( headers ).to eq( { 'Content-Length' => expected.length.to_s } )
|
|
238
|
-
expect( body
|
|
238
|
+
expect( body ).to eq( [ expected ] )
|
|
239
239
|
end
|
|
240
240
|
|
|
241
241
|
it 'returns non-error condition Rack data correctly with both an accurate and an estimated dataset size' do
|
|
@@ -252,7 +252,7 @@ describe Hoodoo::Services::Response do
|
|
|
252
252
|
|
|
253
253
|
expect( status ).to eq( 200 )
|
|
254
254
|
expect( headers ).to eq( { 'Content-Length' => expected.length.to_s } )
|
|
255
|
-
expect( body
|
|
255
|
+
expect( body ).to eq( [ expected ] )
|
|
256
256
|
end
|
|
257
257
|
|
|
258
258
|
it 'should allow pre-encoded strings in the body' do
|
|
@@ -261,7 +261,7 @@ describe Hoodoo::Services::Response do
|
|
|
261
261
|
status, headers, body = @r.for_rack
|
|
262
262
|
|
|
263
263
|
expect(status).to eq(200)
|
|
264
|
-
expect(body
|
|
264
|
+
expect(body).to eq(['Hello World!'])
|
|
265
265
|
end
|
|
266
266
|
|
|
267
267
|
it 'should raise an exception when the body is in an unsupported format' do
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: hoodoo
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.12.
|
|
4
|
+
version: 2.12.6
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Loyalty New Zealand
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2020-
|
|
11
|
+
date: 2020-11-10 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rack
|
|
@@ -184,28 +184,28 @@ dependencies:
|
|
|
184
184
|
requirements:
|
|
185
185
|
- - "~>"
|
|
186
186
|
- !ruby/object:Gem::Version
|
|
187
|
-
version:
|
|
187
|
+
version: 5.2.4.3
|
|
188
188
|
type: :development
|
|
189
189
|
prerelease: false
|
|
190
190
|
version_requirements: !ruby/object:Gem::Requirement
|
|
191
191
|
requirements:
|
|
192
192
|
- - "~>"
|
|
193
193
|
- !ruby/object:Gem::Version
|
|
194
|
-
version:
|
|
194
|
+
version: 5.2.4.3
|
|
195
195
|
- !ruby/object:Gem::Dependency
|
|
196
196
|
name: activesupport
|
|
197
197
|
requirement: !ruby/object:Gem::Requirement
|
|
198
198
|
requirements:
|
|
199
199
|
- - "~>"
|
|
200
200
|
- !ruby/object:Gem::Version
|
|
201
|
-
version:
|
|
201
|
+
version: 5.2.4.3
|
|
202
202
|
type: :development
|
|
203
203
|
prerelease: false
|
|
204
204
|
version_requirements: !ruby/object:Gem::Requirement
|
|
205
205
|
requirements:
|
|
206
206
|
- - "~>"
|
|
207
207
|
- !ruby/object:Gem::Version
|
|
208
|
-
version:
|
|
208
|
+
version: 5.2.4.3
|
|
209
209
|
- !ruby/object:Gem::Dependency
|
|
210
210
|
name: database_cleaner
|
|
211
211
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -598,7 +598,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
598
598
|
- !ruby/object:Gem::Version
|
|
599
599
|
version: '0'
|
|
600
600
|
requirements: []
|
|
601
|
-
rubygems_version: 3.1.
|
|
601
|
+
rubygems_version: 3.1.4
|
|
602
602
|
signing_key:
|
|
603
603
|
specification_version: 4
|
|
604
604
|
summary: Opinionated APIs
|