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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ce5cc7ceb2e97f6d89d729d698a9aeeea910a00
4
- data.tar.gz: ab72610052c96c506e621036a9b0a0a95c79123b
3
+ metadata.gz: 4fb6043c6ff3de6d36965017bffec730b1659f17
4
+ data.tar.gz: 32cf30b232c83c0a42c969ff24ce78f362a3bd6c
5
5
  SHA512:
6
- metadata.gz: ef3676f7fbedebb4b8837ce1eb75460fd308554b342f2948be204a68a9bfdca4660495e6f7bb2c9d52da04456780cc4ac7655b0085d61ec01886020d568813ad
7
- data.tar.gz: 3591412c2147fa17d98d7ac4b5a5f249cbc4395f9010e4656fa2c1dc324e460e1986446374a504be7a28ed42960014e2b0da7fcb469af8efc55db512a696ddab
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! no_params: true
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
@@ -1,3 +1,3 @@
1
1
  module RemoteResource
2
- VERSION = '0.4.8'
2
+ VERSION = '0.4.9'
3
3
  end
@@ -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 no_params' do
28
- expect(RemoteResource::Request).to receive(:new).with(dummy_class, :get, { id: '12' }, { no_params: true }).and_call_original
29
- expect_any_instance_of(RemoteResource::Request).to receive(:perform)
30
- dummy_class.find '12'
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 '12'
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
 
@@ -2,7 +2,7 @@ require 'spec_helper'
2
2
 
3
3
  describe RemoteResource::VERSION do
4
4
 
5
- it { should eql '0.4.8' }
5
+ it { should eql '0.4.9' }
6
6
  end
7
7
 
8
8
 
@@ -1,4 +1,5 @@
1
1
  $LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
2
2
  require 'remote_resource'
3
3
 
4
+ require 'webmock/rspec'
4
5
  require 'pry'
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.8
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-03-21 00:00:00.000000000 Z
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