shutl_resource 1.7.1 → 1.7.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/shutl/resource/rest_class_methods.rb +1 -1
- data/lib/shutl/resource/version.rb +1 -1
- data/spec/rest_resource_spec.rb +42 -16
- 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: 0ddcc271e6cf7f37215c62feb2b2815cafc589b4
|
4
|
+
data.tar.gz: 5d289b691593e187a2d02dab517ab41df930edef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cfbf27b564aa4ab98cd4af6fe599f277c1baecea7e5e3958003c2c66e93ce8da8dbf57169cadf76529496f48895512bef9ccf32e5eb1ef7ec3be9a36977fe46e
|
7
|
+
data.tar.gz: 0936ee3c35a6b740f70479d7599f2b3fdbd38240271176e5d681abf339d6f8d00acf9ed9fc0bb10ebce9bff453d68d568d207a5d3422b0bc021afb2adcf00262
|
@@ -91,7 +91,7 @@ module Shutl::Resource
|
|
91
91
|
|
92
92
|
def split_hash h
|
93
93
|
partitions = h.partition { |key, value| yield key, value }
|
94
|
-
[Hash[partitions.first], Hash[partitions.last]]
|
94
|
+
[Hash[partitions.first].with_indifferent_access, Hash[partitions.last].with_indifferent_access]
|
95
95
|
end
|
96
96
|
|
97
97
|
def split_url_args args
|
data/spec/rest_resource_spec.rb
CHANGED
@@ -347,26 +347,52 @@ describe Shutl::Resource::Rest do
|
|
347
347
|
to_return(:status => 200, :body => '{"test_rests": [{ "a": "a", "b": 2 }]}', :headers => {})
|
348
348
|
end
|
349
349
|
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
|
354
|
-
|
355
|
-
|
350
|
+
context 'accepting symbols as keys in header hash' do
|
351
|
+
let(:result) do
|
352
|
+
TestRest.all(
|
353
|
+
auth: 'TOKEN',
|
354
|
+
headers: {some: 'headers'},
|
355
|
+
from: 'bob@example.com')
|
356
|
+
end
|
356
357
|
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
358
|
+
it 'should not have auth token' do
|
359
|
+
result.first.attributes.should_not have_key('auth')
|
360
|
+
result.first.attributes.should_not have_key(:auth)
|
361
|
+
end
|
361
362
|
|
362
|
-
|
363
|
-
|
364
|
-
|
363
|
+
it 'should not have headers' do
|
364
|
+
result.first.attributes.should_not have_key('headers')
|
365
|
+
result.first.attributes.should_not have_key(:headers)
|
366
|
+
end
|
367
|
+
|
368
|
+
it 'should not have from email' do
|
369
|
+
result.first.attributes.should_not have_key('from')
|
370
|
+
result.first.attributes.should_not have_key(:from)
|
371
|
+
end
|
365
372
|
end
|
366
373
|
|
367
|
-
|
368
|
-
result
|
369
|
-
|
374
|
+
context 'accepting strings as keys in header hash' do
|
375
|
+
let(:result) do
|
376
|
+
TestRest.all(
|
377
|
+
'auth' => 'TOKEN',
|
378
|
+
'headers' => {some: 'headers'},
|
379
|
+
'from' => 'bob@example.com')
|
380
|
+
end
|
381
|
+
|
382
|
+
it 'should not have auth token' do
|
383
|
+
result.first.attributes.should_not have_key('auth')
|
384
|
+
result.first.attributes.should_not have_key(:auth)
|
385
|
+
end
|
386
|
+
|
387
|
+
it 'should not have headers' do
|
388
|
+
result.first.attributes.should_not have_key('headers')
|
389
|
+
result.first.attributes.should_not have_key(:headers)
|
390
|
+
end
|
391
|
+
|
392
|
+
it 'should not have from email' do
|
393
|
+
result.first.attributes.should_not have_key('from')
|
394
|
+
result.first.attributes.should_not have_key(:from)
|
395
|
+
end
|
370
396
|
end
|
371
397
|
end
|
372
398
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: shutl_resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- David Rouchy
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2014-
|
16
|
+
date: 2014-11-13 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: shutl_auth
|