shutl_resource 1.5.5 → 1.5.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -37,7 +37,8 @@ module Shutl::Resource
|
|
37
37
|
|
38
38
|
check_fail response, "Failed to find #{name}! args: #{args}, params: #{params}"
|
39
39
|
|
40
|
-
|
40
|
+
parent_attributes = response.body[@resource_name] || {}
|
41
|
+
including_parent_attributes = parent_attributes.merge args
|
41
42
|
new_object including_parent_attributes, response.body
|
42
43
|
end
|
43
44
|
|
data/spec/rest_resource_spec.rb
CHANGED
@@ -233,6 +233,18 @@ describe Shutl::Resource::Rest do
|
|
233
233
|
end
|
234
234
|
|
235
235
|
end
|
236
|
+
|
237
|
+
context 'with returned error' do
|
238
|
+
before do
|
239
|
+
@request = stub_request(:get, 'http://host/test_rests/a?arg1=val1&arg2=val2').
|
240
|
+
to_return(:status => 200, :body => '{"errors": { "base":["Bing::DistanceLookupError"] } }', :headers => headers)
|
241
|
+
end
|
242
|
+
|
243
|
+
it 'should contain the errors' do
|
244
|
+
resource = TestRest.find('a', arg1: 'val1', arg2: 'val2')
|
245
|
+
resource.errors.should == { 'base' => ["Bing::DistanceLookupError"]}
|
246
|
+
end
|
247
|
+
end
|
236
248
|
end
|
237
249
|
|
238
250
|
describe '#all' do
|
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.5.
|
4
|
+
version: 1.5.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2014-01-
|
15
|
+
date: 2014-01-21 00:00:00.000000000 Z
|
16
16
|
dependencies:
|
17
17
|
- !ruby/object:Gem::Dependency
|
18
18
|
name: shutl_auth
|
@@ -213,12 +213,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
213
213
|
- - ! '>='
|
214
214
|
- !ruby/object:Gem::Version
|
215
215
|
version: '0'
|
216
|
+
segments:
|
217
|
+
- 0
|
218
|
+
hash: -2145160790752704754
|
216
219
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
217
220
|
none: false
|
218
221
|
requirements:
|
219
222
|
- - ! '>='
|
220
223
|
- !ruby/object:Gem::Version
|
221
224
|
version: '0'
|
225
|
+
segments:
|
226
|
+
- 0
|
227
|
+
hash: -2145160790752704754
|
222
228
|
requirements: []
|
223
229
|
rubyforge_project:
|
224
230
|
rubygems_version: 1.8.23
|