medlink 0.3.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/lib/medlink/institution.rb +2 -0
- data/lib/medlink/profession.rb +1 -0
- data/lib/medlink/user.rb +1 -0
- data/lib/medlink/version.rb +1 -1
- data/spec/cassettes/{users.yml → users/search/julien.yml} +0 -0
- data/spec/cassettes/users/search/william.yml +67 -0
- data/spec/users_spec.rb +36 -11
- metadata +6 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 56c07fe54822558e208db1fe1ce4249f4547f6e4
|
4
|
+
data.tar.gz: 3a84250116c6077029e1351d98ea260a9ecd776d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65848d012d1eacd6af257fa655bdb2e0aed3e3b2f88ac5a5becba87b4ce8d1c0715c9f9d75e27f346ab1c965f3f17b2d8ff6cf390c85019c926c1f825a5f27d5
|
7
|
+
data.tar.gz: 2351dbaf728dbb2519ddc8ef23a9d2ed8924e9051176aa7057ecaa970ff4a1a842f3530d8946b70149f6b1f5d4315693f33d5b6f249f39d20762145850702900
|
data/Gemfile.lock
CHANGED
data/lib/medlink/institution.rb
CHANGED
data/lib/medlink/profession.rb
CHANGED
data/lib/medlink/user.rb
CHANGED
@@ -11,6 +11,7 @@ module Medlink
|
|
11
11
|
attribute :speciality, Medlink::Speciality
|
12
12
|
attribute :city, Medlink::City
|
13
13
|
attribute :profession, Medlink::Profession
|
14
|
+
attribute :institutions, [Medlink::Institution]
|
14
15
|
|
15
16
|
def self.search(params = {})
|
16
17
|
json = client.post("#{path}/search", params)
|
data/lib/medlink/version.rb
CHANGED
File without changes
|
@@ -0,0 +1,67 @@
|
|
1
|
+
---
|
2
|
+
http_interactions:
|
3
|
+
- request:
|
4
|
+
method: post
|
5
|
+
uri: https://medlink.planning-de-garde.fr/api/users/search
|
6
|
+
body:
|
7
|
+
encoding: UTF-8
|
8
|
+
string: '{"first_name":"William","last_name":"Eclancher"}'
|
9
|
+
headers:
|
10
|
+
User-Agent:
|
11
|
+
- Faraday v0.10.0
|
12
|
+
Authorization:
|
13
|
+
- Token token="b12186d9d390fc2d9df5d6869fc0c008"
|
14
|
+
Content-Type:
|
15
|
+
- application/json
|
16
|
+
Accept:
|
17
|
+
- application/json
|
18
|
+
Accept-Encoding:
|
19
|
+
- gzip;q=1.0,deflate;q=0.6,identity;q=0.3
|
20
|
+
response:
|
21
|
+
status:
|
22
|
+
code: 200
|
23
|
+
message: OK
|
24
|
+
headers:
|
25
|
+
Date:
|
26
|
+
- Fri, 30 Dec 2016 16:34:04 GMT
|
27
|
+
Content-Type:
|
28
|
+
- application/json; charset=utf-8
|
29
|
+
Transfer-Encoding:
|
30
|
+
- chunked
|
31
|
+
Connection:
|
32
|
+
- keep-alive
|
33
|
+
Set-Cookie:
|
34
|
+
- __cfduid=d137ad86a18fa4b4cca1f90b6c80f39de1483115644; expires=Sat, 30-Dec-17
|
35
|
+
16:34:04 GMT; path=/; domain=.planning-de-garde.fr; HttpOnly
|
36
|
+
X-Frame-Options:
|
37
|
+
- SAMEORIGIN
|
38
|
+
X-Xss-Protection:
|
39
|
+
- 1; mode=block
|
40
|
+
X-Content-Type-Options:
|
41
|
+
- nosniff
|
42
|
+
Etag:
|
43
|
+
- W/"7b3aee00c88c6a6d34f641ecd381353d"
|
44
|
+
Cache-Control:
|
45
|
+
- max-age=0, private, must-revalidate
|
46
|
+
X-Request-Id:
|
47
|
+
- d3d577c2-8e62-4ef8-a9a5-7d35098fe1e1
|
48
|
+
X-Runtime:
|
49
|
+
- '0.053550'
|
50
|
+
Vary:
|
51
|
+
- Accept-Encoding
|
52
|
+
Via:
|
53
|
+
- 1.1 vegur
|
54
|
+
Server:
|
55
|
+
- cloudflare-nginx
|
56
|
+
Cf-Ray:
|
57
|
+
- 3196e5a73889091a-CDG
|
58
|
+
body:
|
59
|
+
encoding: UTF-8
|
60
|
+
string: '[{"id":132251,"rpps":"810004085790","first_name":"William","last_name":"Eclancher","birthdate":null,"ecn_year":null,"ecn_ranking":null,"internat_end_year":null,"city":null,"speciality":{"id":34,"name":"Spécialiste
|
61
|
+
en Médecine Générale","duration":5},"profession":{"id":2,"code":"10","name":"Médecin"},"emails":[{"value":"weclancher@yahoo.fr","trusted":true}],"institutions":[{"id":125215,"finess":null,"name":"CABINET
|
62
|
+
DU DR WILLIAM ECLANCHER","siret":null,"google_place_id":"ChIJRT4fdr165kcRPpL76mMjD-M","google_formatted_address":"11
|
63
|
+
Rue Charles Tellier, 75016 Paris, France","google_formatted_phone_number":"01
|
64
|
+
45 27 15 33","city":{"id":517,"name":"Paris"}}]}]'
|
65
|
+
http_version:
|
66
|
+
recorded_at: Fri, 30 Dec 2016 16:34:04 GMT
|
67
|
+
recorded_with: VCR 3.0.3
|
data/spec/users_spec.rb
CHANGED
@@ -4,22 +4,47 @@ describe Medlink::User do
|
|
4
4
|
|
5
5
|
describe ":search" do
|
6
6
|
|
7
|
+
context "valid token" do
|
8
|
+
before(:each) do
|
9
|
+
VCR.use_cassette "users/search/julien" do
|
10
|
+
@searched_user = Medlink::User.search(first_name: "Julien", last_name: "Vibert").first
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
it { expect(@searched_user.ecn_ranking).to eq(1) }
|
15
|
+
it { expect(@searched_user.ecn_year).to eq(2015) }
|
16
|
+
it { expect(@searched_user.internat_end_year).to eq(2020) }
|
17
|
+
it { expect(@searched_user.first_name).to eq("Julien") }
|
18
|
+
it { expect(@searched_user.last_name).to eq("Vibert") }
|
19
|
+
it { expect(@searched_user.birthdate).to eq Date.new(1990, 7, 16) }
|
20
|
+
it { expect(@searched_user.speciality.name).to eq("Oncologie médicale") }
|
21
|
+
it { expect(@searched_user.city.name).to eq("Paris") }
|
22
|
+
it { expect(@searched_user.profession.name).to eq("Interne") }
|
23
|
+
it { expect(@searched_user.profession.code).to eq(5) }
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
|
7
28
|
context "valid token" do
|
29
|
+
|
8
30
|
before(:each) do
|
9
|
-
VCR.use_cassette "users" do
|
10
|
-
@searched_user = Medlink::User.search(first_name: "
|
31
|
+
VCR.use_cassette "users/search/william" do
|
32
|
+
@searched_user = Medlink::User.search(first_name: "William", last_name: "Eclancher").first
|
11
33
|
end
|
12
34
|
end
|
13
35
|
|
14
|
-
it { expect(@searched_user.ecn_ranking).to
|
15
|
-
it { expect(@searched_user.ecn_year).to
|
16
|
-
it { expect(@searched_user.internat_end_year).to
|
17
|
-
it { expect(@searched_user.first_name).to eq("
|
18
|
-
it { expect(@searched_user.last_name).to eq("
|
19
|
-
it { expect(@searched_user.birthdate).to
|
20
|
-
it { expect(@searched_user.speciality.name).to eq("
|
21
|
-
it { expect(@searched_user.city
|
22
|
-
it { expect(@searched_user.profession.name).to eq("
|
36
|
+
it { expect(@searched_user.ecn_ranking).to be_nil }
|
37
|
+
it { expect(@searched_user.ecn_year).to be_nil }
|
38
|
+
it { expect(@searched_user.internat_end_year).to be_nil }
|
39
|
+
it { expect(@searched_user.first_name).to eq("William") }
|
40
|
+
it { expect(@searched_user.last_name).to eq("Eclancher") }
|
41
|
+
it { expect(@searched_user.birthdate).to be_nil }
|
42
|
+
it { expect(@searched_user.speciality.name).to eq("Spécialiste en Médecine Générale") }
|
43
|
+
it { expect(@searched_user.city).to be_nil }
|
44
|
+
it { expect(@searched_user.profession.name).to eq("Médecin") }
|
45
|
+
it { expect(@searched_user.profession.code).to eq(10) }
|
46
|
+
|
47
|
+
it { expect(@searched_user.institutions.first.name).to eq("CABINET DU DR WILLIAM ECLANCHER") }
|
23
48
|
|
24
49
|
end
|
25
50
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: medlink
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Etienne Depaulis
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-12-
|
11
|
+
date: 2016-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -154,7 +154,8 @@ files:
|
|
154
154
|
- spec/activities_spec.rb
|
155
155
|
- spec/cassettes/activities.yml
|
156
156
|
- spec/cassettes/emails.yml
|
157
|
-
- spec/cassettes/users.yml
|
157
|
+
- spec/cassettes/users/search/julien.yml
|
158
|
+
- spec/cassettes/users/search/william.yml
|
158
159
|
- spec/emails_spec.rb
|
159
160
|
- spec/spec_helper.rb
|
160
161
|
- spec/users_spec.rb
|
@@ -186,7 +187,8 @@ test_files:
|
|
186
187
|
- spec/activities_spec.rb
|
187
188
|
- spec/cassettes/activities.yml
|
188
189
|
- spec/cassettes/emails.yml
|
189
|
-
- spec/cassettes/users.yml
|
190
|
+
- spec/cassettes/users/search/julien.yml
|
191
|
+
- spec/cassettes/users/search/william.yml
|
190
192
|
- spec/emails_spec.rb
|
191
193
|
- spec/spec_helper.rb
|
192
194
|
- spec/users_spec.rb
|