ddy_remote_resource 0.4.8 → 0.4.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/remote_resource/querying/finder_methods.rb +1 -1
- data/lib/remote_resource/version.rb +1 -1
- data/remote_resource.gemspec +1 -0
- data/spec/lib/remote_resource/querying/finder_methods_spec.rb +15 -5
- data/spec/lib/remote_resource/version_spec.rb +1 -1
- data/spec/spec_helper.rb +1 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fb6043c6ff3de6d36965017bffec730b1659f17
|
4
|
+
data.tar.gz: 32cf30b232c83c0a42c969ff24ce78f362a3bd6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 948ad8bad7470092350a50a357f63810ff24728e4b9b4114766a64d56c217e720ba76727b4ea3b4c3a982e044db6c4e4a905b0cf0626fba01cdee7060338dffc
|
7
|
+
data.tar.gz: 02723a379602c6bb06e99b7c63882d833a79562122951e886c050ee7c4dd044d0242e85168eae0d3fe5d86a90155d03627e1c9e2d5bafb87409ffdf555349aec
|
@@ -6,7 +6,7 @@ module RemoteResource
|
|
6
6
|
module ClassMethods
|
7
7
|
|
8
8
|
def find(id, connection_options = {})
|
9
|
-
connection_options.merge!
|
9
|
+
connection_options.merge! no_attributes: true
|
10
10
|
response = RemoteResource::Request.new(self, :get, { id: id }, connection_options).perform
|
11
11
|
build_resource_from_response response
|
12
12
|
end
|
data/remote_resource.gemspec
CHANGED
@@ -22,6 +22,7 @@ Gem::Specification.new do |spec|
|
|
22
22
|
spec.add_development_dependency 'rake', '~> 10.4'
|
23
23
|
spec.add_development_dependency 'rspec', '~> 3.1'
|
24
24
|
spec.add_development_dependency 'pry', '~> 0.10'
|
25
|
+
spec.add_development_dependency 'webmock', '~> 1.24'
|
25
26
|
|
26
27
|
spec.add_runtime_dependency 'activesupport', '~> 4.1'
|
27
28
|
spec.add_runtime_dependency 'activemodel', '~> 4.1'
|
@@ -24,15 +24,25 @@ describe RemoteResource::Querying::FinderMethods do
|
|
24
24
|
allow_any_instance_of(RemoteResource::Request).to receive(:perform) { response }
|
25
25
|
end
|
26
26
|
|
27
|
-
it 'performs a RemoteResource::Request with the connection_options
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
it 'performs a RemoteResource::Request with the connection_options no_attributes' do
|
28
|
+
stub_request(:get, 'https://foobar.com/finder_methods_dummy/12.json').to_return(status: 200, body: {}.to_json)
|
29
|
+
expect(RemoteResource::Request).to receive(:new).with(dummy_class, :get, { id: '12' }, { no_attributes: true }).and_call_original
|
30
|
+
expect_any_instance_of(RemoteResource::Request).to receive(:perform).and_call_original
|
31
|
+
dummy_class.find('12')
|
31
32
|
end
|
32
33
|
|
33
34
|
it 'builds the resource from the RemoteResource::Response' do
|
34
35
|
expect(dummy_class).to receive(:build_resource_from_response).with response
|
35
|
-
dummy_class.find
|
36
|
+
dummy_class.find('12')
|
37
|
+
end
|
38
|
+
|
39
|
+
context 'with extra params' do
|
40
|
+
it 'performs a RemoteResource::Request with params' do
|
41
|
+
stub_request(:get, 'https://foobar.com/finder_methods_dummy/12.json?skip_associations=true').to_return(status: 200, body: {}.to_json)
|
42
|
+
expect(RemoteResource::Request).to receive(:new).with(dummy_class, :get, { id: '12' }, { params: { skip_associations: true }, no_attributes: true }).and_call_original
|
43
|
+
expect_any_instance_of(RemoteResource::Request).to receive(:perform).and_call_original
|
44
|
+
dummy_class.find('12', params: { skip_associations: true })
|
45
|
+
end
|
36
46
|
end
|
37
47
|
end
|
38
48
|
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ddy_remote_resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jan van der Pas
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-04-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -66,6 +66,20 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '0.10'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: webmock
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '1.24'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '1.24'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: activesupport
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|