contactually-api 0.0.4 → 0.0.5

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: 5b229529b6cd9e6c9e1194c9b8f9dfd815716f59
4
- data.tar.gz: 207a10352a62b760a13060c3d02f629adb65f9d6
3
+ metadata.gz: ad56375cc4f733c53ed4180d476bc435ca6d47eb
4
+ data.tar.gz: 368daf75ca9581ca6985c9bb79987789c617960f
5
5
  SHA512:
6
- metadata.gz: 7ea7125518a774970476ef75ae2bf4e94592cc8bb74c44bbdb98f2b885effd0e79850c3d261da2de334a899a77346326f3f1c900832ec8c6635d35086b77610b
7
- data.tar.gz: 778405c57ad558e5c634b9608a429cdab695ad7f402ed07eb770dca04a4999f594fd80458de11f03f89d2a226be787be830aa427271a9f3417db2c15196339b4
6
+ metadata.gz: 065e397609b59b9d0e5c5d6bf2843450e82bbc497863d3abde0ce2202f59efee70ef372412631b1fcc793012b6c07a61aacfb9941817ba9fc1947d060039ccca
7
+ data.tar.gz: 9bf5c9fed47a5140b5386de06f3b66fc77960bae25797ecbee0a3cab2bf33df5178081e434276a0444c34bda5618fe6b03376e74a65bf6bde4ab0418c1d140f4
@@ -33,7 +33,8 @@ module Contactually
33
33
  end
34
34
 
35
35
  def update(id, params = {})
36
- @master.call("contacts/#{id}.json", :put, params)
36
+ hash = @master.call("contacts/#{id}.json", :put, params)
37
+ Contactually::Utils.build_contact(hash);
37
38
  end
38
39
 
39
40
  def index(params = {})
@@ -1,3 +1,3 @@
1
1
  module Contactually
2
- VERSION = "0.0.4"
2
+ VERSION = "0.0.5"
3
3
  end
@@ -79,10 +79,15 @@ describe Contactually::Contacts do
79
79
 
80
80
  describe '#update' do
81
81
  it 'calls the api with correct params' do
82
- allow(@master).to receive(:call).with('contacts/1.json', :put, { contact: { foo: :bar }})
82
+ allow(@master).to receive(:call).with('contacts/1.json', :put, { contact: { foo: :bar }}).and_return(JSON.load(contact_json))
83
83
  subject.update(1, { contact: { foo: :bar } })
84
84
  expect(@master).to have_received(:call)
85
85
  end
86
+
87
+ it 'returns a contact from json response' do
88
+ allow(@master).to receive(:call).with('contacts/1.json', :put, { contact: { foo: :bar }}).and_return(JSON.load(contact_json))
89
+ expect(subject.update(1, { contact: { foo: :bar }})).to be_kind_of Contactually::Contact
90
+ end
86
91
  end
87
92
 
88
93
  describe '#index' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: contactually-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Heck
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-04 00:00:00.000000000 Z
11
+ date: 2014-11-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport