patient_zero 0.2.1 → 0.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 77ad97aacf438a7b62edef293658bf31d20ad5fe
4
- data.tar.gz: 925675627f483aad448716cabdc8336c027e8e70
3
+ metadata.gz: 986f8ed157da8c5cfd002539e08ba67b214e5cec
4
+ data.tar.gz: a89ba560beb80054824ec480edc7ca8681a281fd
5
5
  SHA512:
6
- metadata.gz: a36b50cd9f6e444702fec738e1997f45d97a895629a184c7376aaa7665dd4336d2731b741ce1aea2096c2b1af3799926d9e8f88daa7ca5c9d569b9cc8700c67c
7
- data.tar.gz: d27490bf2b18d59649f6cf83f52fc8f682a574c8f7e1b87d2dc2ce87c9f79e8b3df1634620ea53e20a23cbbd15bdc0e4ecfa674a80033b338e61154a1c59d5e5
6
+ metadata.gz: c939f5cc167ead485b684cbf1e3f3aea8a0dc37b6aedeb9b66c2101e8f31346422a9d53a9bec67749dcaa0e54eb704572d8bdb4a5266a4b7022680875d40c361
7
+ data.tar.gz: 67a76674e62505781e1067a8fc393251b70107db7e179b27f489edb8086fd09f1b5da39ba98796b0f1f48bf314022ce32e2fc2a72e4092b45eb59f1efe8658be
@@ -22,6 +22,10 @@ module PatientZero
22
22
  parse connection.post *args
23
23
  end
24
24
 
25
+ def self.put *args
26
+ parse connection.put *args
27
+ end
28
+
25
29
  private
26
30
 
27
31
  def get *args
@@ -31,5 +35,9 @@ module PatientZero
31
35
  def post *args
32
36
  self.class.post *args
33
37
  end
38
+
39
+ def put *args
40
+ self.class.put *args
41
+ end
34
42
  end
35
43
  end
@@ -27,5 +27,10 @@ module PatientZero
27
27
  response = post '/social/api/v2/monitoring/profiles', api_key: PatientZero.api_key, profile: params
28
28
  new response['profile']
29
29
  end
30
+
31
+ def self.update params={}
32
+ response = put "/social/api/v2/monitoring/profiles/#{params[:id]}", api_key: PatientZero.api_key, profile: params
33
+ new response['profile']
34
+ end
30
35
  end
31
36
  end
@@ -1,3 +1,3 @@
1
1
  module PatientZero
2
- VERSION = "0.2.1"
2
+ VERSION = "0.2.2"
3
3
  end
@@ -60,5 +60,20 @@ module PatientZero
60
60
  expect(Profile.create(profile_data)).to be_a Profile
61
61
  end
62
62
  end
63
+
64
+ describe '.update' do
65
+ let(:params) { {id: 1} }
66
+ let(:profile_response) { response_with_body profile: profile_data }
67
+ before { allow(Client.connection).to receive(:put).with("/social/api/v2/monitoring/profiles/#{params[:id]}", anything) { profile_response } }
68
+
69
+ it 'calls the profiles api endpoint' do
70
+ expect(Client.connection).to receive(:put).with("/social/api/v2/monitoring/profiles/#{params[:id]}", anything)
71
+ Profile.update params
72
+ end
73
+
74
+ it 'returns a Profile object' do
75
+ expect(Profile.update(params)).to be_a Profile
76
+ end
77
+ end
63
78
  end
64
79
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: patient_zero
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Adam Zaninovich
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2015-04-17 00:00:00.000000000 Z
12
+ date: 2015-04-21 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler