patient_zero 0.2.1 → 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/patient_zero/client.rb +8 -0
- data/lib/patient_zero/profile.rb +5 -0
- data/lib/patient_zero/version.rb +1 -1
- data/spec/patient_zero/profile_spec.rb +15 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 986f8ed157da8c5cfd002539e08ba67b214e5cec
|
4
|
+
data.tar.gz: a89ba560beb80054824ec480edc7ca8681a281fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c939f5cc167ead485b684cbf1e3f3aea8a0dc37b6aedeb9b66c2101e8f31346422a9d53a9bec67749dcaa0e54eb704572d8bdb4a5266a4b7022680875d40c361
|
7
|
+
data.tar.gz: 67a76674e62505781e1067a8fc393251b70107db7e179b27f489edb8086fd09f1b5da39ba98796b0f1f48bf314022ce32e2fc2a72e4092b45eb59f1efe8658be
|
data/lib/patient_zero/client.rb
CHANGED
@@ -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
|
data/lib/patient_zero/profile.rb
CHANGED
@@ -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
|
data/lib/patient_zero/version.rb
CHANGED
@@ -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.
|
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-
|
12
|
+
date: 2015-04-21 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|