contactually-ruby 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/contactually/utils.rb +1 -1
- data/lib/contactually/version.rb +1 -1
- data/spec/accounts_spec.rb +1 -1
- data/spec/buckets_spec.rb +1 -1
- data/spec/contact_groupings_spec.rb +1 -1
- data/spec/contacts_spec.rb +1 -1
- data/spec/contents_spec.rb +1 -1
- data/spec/fixtures/account.json +10 -8
- data/spec/fixtures/bucket.json +8 -6
- data/spec/fixtures/contact.json +38 -36
- data/spec/fixtures/content.json +10 -8
- data/spec/fixtures/grouping.json +19 -17
- data/spec/fixtures/note.json +7 -5
- data/spec/fixtures/task.json +26 -24
- data/spec/groupings_spec.rb +3 -3
- 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: faa362189301f2e0dd58053b961c86f29c2857b3
|
4
|
+
data.tar.gz: 72ef6ecddbd5047a7f8e4e84207e55bc91e5ff79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5029836eb4eed981955147f0796a6847638383ef621cfcd3f3eddf4956baf2ea677cf07fb17a0c811b1beb10a3aa1e512a23b4d8b80575de013afc535e883591
|
7
|
+
data.tar.gz: 6c1550446daf6390e75c502bda7d4d27c974cf5d91b2a495aa3feb0261072d5280b7df5f117ab1bd6e8c95e327c810721a6dcecb3d418c87b8c4a29872551edf
|
data/lib/contactually/utils.rb
CHANGED
@@ -37,7 +37,7 @@ module Contactually
|
|
37
37
|
def build_object(type, hash)
|
38
38
|
representer_class = "Contactually::Representer::#{type.classify}Representer".constantize
|
39
39
|
object_class = "Contactually::#{type.classify}".constantize
|
40
|
-
representer_class.new(object_class.new).from_hash(hash)
|
40
|
+
representer_class.new(object_class.new).from_hash(hash['data'])
|
41
41
|
end
|
42
42
|
end
|
43
43
|
end
|
data/lib/contactually/version.rb
CHANGED
data/spec/accounts_spec.rb
CHANGED
@@ -37,7 +37,7 @@ describe Contactually::Accounts do
|
|
37
37
|
|
38
38
|
describe '#show' do
|
39
39
|
it 'calls the api with correct params' do
|
40
|
-
allow(@master).to receive(:call).with('accounts/1.json', :get, { foo: :bar }).and_return({ id: 1 })
|
40
|
+
allow(@master).to receive(:call).with('accounts/1.json', :get, { foo: :bar }).and_return({ 'data' => {id: 1 }})
|
41
41
|
subject.show(1, { foo: :bar })
|
42
42
|
expect(@master).to have_received(:call)
|
43
43
|
end
|
data/spec/buckets_spec.rb
CHANGED
@@ -44,7 +44,7 @@ describe Contactually::Buckets do
|
|
44
44
|
|
45
45
|
describe '#show' do
|
46
46
|
it 'calls the api with correct params' do
|
47
|
-
allow(@master).to receive(:call).with('buckets/1.json', :get, { foo: :bar }).and_return({ id: 1
|
47
|
+
allow(@master).to receive(:call).with('buckets/1.json', :get, { foo: :bar }).and_return({ 'data' => {id: 1}})
|
48
48
|
subject.show(1, { foo: :bar })
|
49
49
|
expect(@master).to have_received(:call)
|
50
50
|
end
|
@@ -23,7 +23,7 @@ describe Contactually::ContactGroupings do
|
|
23
23
|
|
24
24
|
describe '#create' do
|
25
25
|
it 'calls the api with correct params' do
|
26
|
-
allow(@master).to receive(:call).with('contacts/1/groupings.json', :post, { grouping_id: 512 }).and_return({ 'id' => 1234 })
|
26
|
+
allow(@master).to receive(:call).with('contacts/1/groupings.json', :post, { grouping_id: 512 }).and_return({ 'data' => {'id' => 1234 }})
|
27
27
|
subject.create(1, { grouping_id: 512 })
|
28
28
|
expect(@master).to have_received(:call)
|
29
29
|
end
|
data/spec/contacts_spec.rb
CHANGED
@@ -53,7 +53,7 @@ describe Contactually::Contacts do
|
|
53
53
|
|
54
54
|
describe '#show' do
|
55
55
|
it 'calls the api with correct params' do
|
56
|
-
allow(@master).to receive(:call).with('contacts/1.json', :get, { foo: :bar }).and_return({ id: 1 })
|
56
|
+
allow(@master).to receive(:call).with('contacts/1.json', :get, { foo: :bar }).and_return({ 'data' => {id: 1 }})
|
57
57
|
subject.show(1, { foo: :bar })
|
58
58
|
expect(@master).to have_received(:call)
|
59
59
|
end
|
data/spec/contents_spec.rb
CHANGED
@@ -58,7 +58,7 @@ describe Contactually::Contents do
|
|
58
58
|
|
59
59
|
describe '#show' do
|
60
60
|
it 'calls the api with correct params' do
|
61
|
-
allow(@master).to receive(:call).with('contents/1.json', :get, { foo: :bar }).and_return({ id: 1 })
|
61
|
+
allow(@master).to receive(:call).with('contents/1.json', :get, { foo: :bar }).and_return({ 'data' => {id: 1 }})
|
62
62
|
subject.show(1, { foo: :bar })
|
63
63
|
expect(@master).to have_received(:call)
|
64
64
|
end
|
data/spec/fixtures/account.json
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
2
|
+
"data": {
|
3
|
+
"id": 13123,
|
4
|
+
"username": "lol@rofl.com",
|
5
|
+
"remote_id": "lol@rofl.com",
|
6
|
+
"type": "Account::Google",
|
7
|
+
"disabled_at": null,
|
8
|
+
"name": "Google Contacts",
|
9
|
+
"nice_label": "lol@rofl.com",
|
10
|
+
"can_sync_contacts": true
|
11
|
+
}
|
10
12
|
}
|
data/spec/fixtures/bucket.json
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
2
|
+
"data": {
|
3
|
+
"id": 41296013,
|
4
|
+
"name": "Bucket Test",
|
5
|
+
"goal": "Test",
|
6
|
+
"reminder_interval": 55,
|
7
|
+
"created_at": "2013-07-02T15:45:01Z",
|
8
|
+
"updated_at": "2013-07-02T15:45:01Z"
|
9
|
+
}
|
8
10
|
}
|
data/spec/fixtures/contact.json
CHANGED
@@ -1,38 +1,40 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
"
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
2
|
+
"data": {
|
3
|
+
"id": 41296013,
|
4
|
+
"user_id": 7,
|
5
|
+
"first_name": "Test",
|
6
|
+
"last_name": "Ing",
|
7
|
+
"full_name": "Test Ing",
|
8
|
+
"initials": "TI",
|
9
|
+
"title": "",
|
10
|
+
"company": null,
|
11
|
+
"email": "testing@contact.com",
|
12
|
+
"avatar": "",
|
13
|
+
"avatar_url": "",
|
14
|
+
"last_contacted": null,
|
15
|
+
"visible": true,
|
16
|
+
"twitter": null,
|
17
|
+
"facebook_url": null,
|
18
|
+
"linkedin_url": null,
|
19
|
+
"first_contacted": null,
|
20
|
+
"created_at": "2013-07-02T15:45:01Z",
|
21
|
+
"updated_at": "2013-07-02T15:45:01Z",
|
22
|
+
"hits": 0,
|
23
|
+
"team_parent_id": null,
|
24
|
+
"snoozed_at": null,
|
25
|
+
"snooze_days": null,
|
26
|
+
"groupings": [],
|
27
|
+
"email_addresses": [
|
28
|
+
"testing@contact.com"
|
29
|
+
],
|
30
|
+
"tags": [],
|
31
|
+
"contact_status": null,
|
32
|
+
"team_last_contacted": null,
|
33
|
+
"team_last_contacted_by": null,
|
34
|
+
"phone_numbers": [],
|
35
|
+
"addresses": [],
|
36
|
+
"social_profiles": [],
|
37
|
+
"websites": [],
|
38
|
+
"custom_fields": []
|
39
|
+
}
|
38
40
|
}
|
data/spec/fixtures/content.json
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
2
|
+
"data": {
|
3
|
+
"id": 18,
|
4
|
+
"url": null,
|
5
|
+
"title": "Lolokopter",
|
6
|
+
"description": null,
|
7
|
+
"user_id": 622,
|
8
|
+
"created_at": "2014-09-05T15:26:47Z",
|
9
|
+
"article": null,
|
10
|
+
"groupings": []
|
11
|
+
}
|
10
12
|
}
|
data/spec/fixtures/grouping.json
CHANGED
@@ -1,19 +1,21 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
2
|
+
"data": {
|
3
|
+
"id": 1234123,
|
4
|
+
"type": "Grouping::Bucket",
|
5
|
+
"name": "Acquaintance",
|
6
|
+
"stub": "acquaintance",
|
7
|
+
"user_id": 421232,
|
8
|
+
"domain_id": null,
|
9
|
+
"editable": null,
|
10
|
+
"conversable": null,
|
11
|
+
"locked": false,
|
12
|
+
"derived_from_id": null,
|
13
|
+
"created_at": "2014-08-19T11:29:55Z",
|
14
|
+
"updated_at": "2014-09-03T22:14:05Z",
|
15
|
+
"has_followups": true,
|
16
|
+
"num_days_to_followup": 90,
|
17
|
+
"program_id": null,
|
18
|
+
"objective": false,
|
19
|
+
"sort_order": 0
|
20
|
+
}
|
19
21
|
}
|
data/spec/fixtures/note.json
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
2
|
+
"data": {
|
3
|
+
"id": 1234,
|
4
|
+
"body": "This is a note",
|
5
|
+
"contact_id": 123123,
|
6
|
+
"timestamp": "2014-09-03T09:14:52Z",
|
7
|
+
"user_id": 123
|
8
|
+
}
|
7
9
|
}
|
data/spec/fixtures/task.json
CHANGED
@@ -1,27 +1,29 @@
|
|
1
1
|
{
|
2
|
-
"
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
"
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
"
|
25
|
-
|
2
|
+
"data": {
|
3
|
+
"id": 123123,
|
4
|
+
"title": "Lolokopter",
|
5
|
+
"due_date": "2015-10-01T00:00:00Z",
|
6
|
+
"interaction_type": null,
|
7
|
+
"completed_at": null,
|
8
|
+
"deleted_at": null,
|
9
|
+
"is_follow_up": false,
|
10
|
+
"last_contacted": null,
|
11
|
+
"contact_id": 1234,
|
12
|
+
"ignored": null,
|
13
|
+
"completed_via": null,
|
14
|
+
"user_id": 12345,
|
15
|
+
"approval_data": {
|
16
|
+
"approval_type": false,
|
17
|
+
"approval_text": false,
|
18
|
+
"approval_url": false,
|
19
|
+
"approval_template": false,
|
20
|
+
"approval_account_id": false
|
21
|
+
},
|
22
|
+
"contact_program_step_id": null,
|
23
|
+
"unresponded_followup_id": null,
|
24
|
+
"user_bucket": {
|
25
|
+
"id": 12312,
|
26
|
+
"name": "Colleague"
|
27
|
+
}
|
26
28
|
}
|
27
29
|
}
|
data/spec/groupings_spec.rb
CHANGED
@@ -38,7 +38,7 @@ describe Contactually::Groupings do
|
|
38
38
|
|
39
39
|
describe '#create' do
|
40
40
|
it 'calls the api with correct params' do
|
41
|
-
allow(@master).to receive(:call).with('groupings.json', :post, { grouping: { foo: :bar }}).and_return({ 'id' => 1234 })
|
41
|
+
allow(@master).to receive(:call).with('groupings.json', :post, { grouping: { foo: :bar }}).and_return({ 'data' => {'id' => 1234 }})
|
42
42
|
subject.create({ grouping: { foo: :bar }})
|
43
43
|
expect(@master).to have_received(:call)
|
44
44
|
end
|
@@ -59,7 +59,7 @@ describe Contactually::Groupings do
|
|
59
59
|
|
60
60
|
describe '#show' do
|
61
61
|
it 'calls the api with correct params' do
|
62
|
-
allow(@master).to receive(:call).with('groupings/1.json', :get, { foo: :bar }).and_return({ id: 1234 })
|
62
|
+
allow(@master).to receive(:call).with('groupings/1.json', :get, { foo: :bar }).and_return({ 'data' => {id: 1234 }})
|
63
63
|
subject.show(1, { foo: :bar })
|
64
64
|
expect(@master).to have_received(:call)
|
65
65
|
end
|
@@ -72,7 +72,7 @@ describe Contactually::Groupings do
|
|
72
72
|
|
73
73
|
describe '#update' do
|
74
74
|
it 'calls the api with correct params' do
|
75
|
-
allow(@master).to receive(:call).with('groupings/1.json', :put, { grouping: { foo: :bar }}).and_return({ id: 1234 })
|
75
|
+
allow(@master).to receive(:call).with('groupings/1.json', :put, { grouping: { foo: :bar }}).and_return({ 'data' => {id: 1234 }})
|
76
76
|
subject.update(1, { grouping: { foo: :bar }})
|
77
77
|
expect(@master).to have_received(:call)
|
78
78
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: contactually-ruby
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tim Segraves
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-07-
|
11
|
+
date: 2016-07-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|