clio_client 0.0.1

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.
Files changed (123) hide show
  1. data/.gitignore +18 -0
  2. data/Gemfile +4 -0
  3. data/LICENSE.txt +22 -0
  4. data/README.md +169 -0
  5. data/Rakefile +9 -0
  6. data/clio_client.gemspec +27 -0
  7. data/lib/clio_client/api/activity.rb +23 -0
  8. data/lib/clio_client/api/activity_description.rb +17 -0
  9. data/lib/clio_client/api/base.rb +18 -0
  10. data/lib/clio_client/api/bill.rb +23 -0
  11. data/lib/clio_client/api/calendar.rb +19 -0
  12. data/lib/clio_client/api/calendar_entry.rb +20 -0
  13. data/lib/clio_client/api/communication.rb +25 -0
  14. data/lib/clio_client/api/contact.rb +23 -0
  15. data/lib/clio_client/api/crudable.rb +25 -0
  16. data/lib/clio_client/api/custom_field.rb +19 -0
  17. data/lib/clio_client/api/custom_field_set.rb +19 -0
  18. data/lib/clio_client/api/document.rb +20 -0
  19. data/lib/clio_client/api/document_version.rb +29 -0
  20. data/lib/clio_client/api/findable.rb +16 -0
  21. data/lib/clio_client/api/group.rb +22 -0
  22. data/lib/clio_client/api/listable.rb +44 -0
  23. data/lib/clio_client/api/matter.rb +22 -0
  24. data/lib/clio_client/api/note.rb +22 -0
  25. data/lib/clio_client/api/practice_area.rb +22 -0
  26. data/lib/clio_client/api/relationship.rb +22 -0
  27. data/lib/clio_client/api/task.rb +22 -0
  28. data/lib/clio_client/api/timeline_event.rb +19 -0
  29. data/lib/clio_client/api/timer.rb +31 -0
  30. data/lib/clio_client/api/user.rb +31 -0
  31. data/lib/clio_client/authorization.rb +41 -0
  32. data/lib/clio_client/http.rb +92 -0
  33. data/lib/clio_client/models/account.rb +16 -0
  34. data/lib/clio_client/models/activity.rb +31 -0
  35. data/lib/clio_client/models/activity_description.rb +21 -0
  36. data/lib/clio_client/models/bill.rb +45 -0
  37. data/lib/clio_client/models/calendar.rb +19 -0
  38. data/lib/clio_client/models/calendar_entry.rb +32 -0
  39. data/lib/clio_client/models/communication.rb +34 -0
  40. data/lib/clio_client/models/company.rb +7 -0
  41. data/lib/clio_client/models/contact.rb +38 -0
  42. data/lib/clio_client/models/custom_field.rb +21 -0
  43. data/lib/clio_client/models/custom_field_set.rb +21 -0
  44. data/lib/clio_client/models/document.rb +33 -0
  45. data/lib/clio_client/models/document_version.rb +26 -0
  46. data/lib/clio_client/models/email_communication.rb +8 -0
  47. data/lib/clio_client/models/expense_entry.rb +9 -0
  48. data/lib/clio_client/models/group.rb +18 -0
  49. data/lib/clio_client/models/matter.rb +45 -0
  50. data/lib/clio_client/models/note.rb +23 -0
  51. data/lib/clio_client/models/person.rb +9 -0
  52. data/lib/clio_client/models/phone_communication.rb +8 -0
  53. data/lib/clio_client/models/practice_area.rb +18 -0
  54. data/lib/clio_client/models/relationship.rb +19 -0
  55. data/lib/clio_client/models/task.rb +29 -0
  56. data/lib/clio_client/models/time_entry.rb +9 -0
  57. data/lib/clio_client/models/timeline_event.rb +25 -0
  58. data/lib/clio_client/models/timer.rb +28 -0
  59. data/lib/clio_client/models/user.rb +28 -0
  60. data/lib/clio_client/resource.rb +183 -0
  61. data/lib/clio_client/session.rb +56 -0
  62. data/lib/clio_client/support/address.rb +16 -0
  63. data/lib/clio_client/support/custom_field_checkbox_value.rb +7 -0
  64. data/lib/clio_client/support/custom_field_contact_value.rb +10 -0
  65. data/lib/clio_client/support/custom_field_currency_value.rb +7 -0
  66. data/lib/clio_client/support/custom_field_date_value.rb +7 -0
  67. data/lib/clio_client/support/custom_field_email_value.rb +7 -0
  68. data/lib/clio_client/support/custom_field_matter_value.rb +9 -0
  69. data/lib/clio_client/support/custom_field_numeric_value.rb +7 -0
  70. data/lib/clio_client/support/custom_field_picklist_option.rb +13 -0
  71. data/lib/clio_client/support/custom_field_picklist_value.rb +9 -0
  72. data/lib/clio_client/support/custom_field_text_area_value.rb +7 -0
  73. data/lib/clio_client/support/custom_field_text_line_value.rb +7 -0
  74. data/lib/clio_client/support/custom_field_time_value.rb +7 -0
  75. data/lib/clio_client/support/custom_field_url_value.rb +7 -0
  76. data/lib/clio_client/support/custom_field_value.rb +13 -0
  77. data/lib/clio_client/support/email_address.rb +12 -0
  78. data/lib/clio_client/support/instant_messenger.rb +12 -0
  79. data/lib/clio_client/support/phone_number.rb +13 -0
  80. data/lib/clio_client/support/rate.rb +16 -0
  81. data/lib/clio_client/support/reminder.rb +11 -0
  82. data/lib/clio_client/support/web_site.rb +12 -0
  83. data/lib/clio_client/version.rb +3 -0
  84. data/lib/clio_client.rb +107 -0
  85. data/spec/api/crudable_spec.rb +54 -0
  86. data/spec/api/findable_spec.rb +25 -0
  87. data/spec/api/listable_spec.rb +27 -0
  88. data/spec/features/activities_spec.rb +35 -0
  89. data/spec/models/account_spec.rb +12 -0
  90. data/spec/models/activity_description_spec.rb +47 -0
  91. data/spec/models/activity_spec.rb +29 -0
  92. data/spec/models/bill_spec.rb +63 -0
  93. data/spec/models/calendar_entry_spec.rb +62 -0
  94. data/spec/models/calendar_spec.rb +20 -0
  95. data/spec/models/communication_spec.rb +39 -0
  96. data/spec/models/company_spec.rb +5 -0
  97. data/spec/models/contact_spec.rb +5 -0
  98. data/spec/models/custom_field_set_spec.rb +5 -0
  99. data/spec/models/custom_field_spec.rb +5 -0
  100. data/spec/models/document_spec.rb +5 -0
  101. data/spec/models/document_version_spec.rb +6 -0
  102. data/spec/models/email_communication_spec.rb +6 -0
  103. data/spec/models/expense_entry_spec.rb +5 -0
  104. data/spec/models/group_spec.rb +5 -0
  105. data/spec/models/matter_spec.rb +5 -0
  106. data/spec/models/note_spec.rb +5 -0
  107. data/spec/models/person_spec.rb +5 -0
  108. data/spec/models/phone_communication_spec.rb +5 -0
  109. data/spec/models/practice_area_spec.rb +5 -0
  110. data/spec/models/relationship_spec.rb +5 -0
  111. data/spec/models/resource_spec.rb +116 -0
  112. data/spec/models/task_spec.rb +5 -0
  113. data/spec/models/time_entry_spec.rb +41 -0
  114. data/spec/models/timeline_event_spec.rb +6 -0
  115. data/spec/models/timer_spec.rb +6 -0
  116. data/spec/models/user_spec.rb +5 -0
  117. data/spec/spec_helper.rb +25 -0
  118. data/spec/support/associated_resource.rb +6 -0
  119. data/spec/support/dummy_endpoint.rb +11 -0
  120. data/spec/support/inherited_resource.rb +2 -0
  121. data/spec/support/resource_examples.rb +82 -0
  122. data/spec/support/test_resource.rb +11 -0
  123. metadata +286 -0
@@ -0,0 +1,12 @@
1
+ module ClioClient
2
+ class EmailAddress < Resource
3
+
4
+ set_attributes(id: {type: :int, readonly: true},
5
+ created_at: {type: :datetime, readonly: true},
6
+ updated_at: {type: :datetime, readonly: true},
7
+ name: {type: :string},
8
+ address: {type: :string}
9
+ )
10
+
11
+ end
12
+ end
@@ -0,0 +1,12 @@
1
+ module ClioClient
2
+ class InstantMessenger < Resource
3
+
4
+ set_attributes(id: {type: :int, readonly: true},
5
+ created_at: {type: :datetime, readonly: true},
6
+ updated_at: {type: :datetime, readonly: true},
7
+ name: {type: :string},
8
+ address: {type: :string},
9
+ )
10
+
11
+ end
12
+ end
@@ -0,0 +1,13 @@
1
+ module ClioClient
2
+ class PhoneNumber < Resource
3
+
4
+ set_attributes(id: {type: :int, readonly: true},
5
+ created_at: {type: :datetime, readonly: true},
6
+ updated_at: {type: :datetime, readonly: true},
7
+ name: {type: :string},
8
+ number: {type: :string},
9
+ default_number: {type: :boolean},
10
+ )
11
+
12
+ end
13
+ end
@@ -0,0 +1,16 @@
1
+ module ClioClient
2
+
3
+ class Rate < Resource
4
+ set_attributes(id: {type: :int, readonly: true},
5
+ created_at: {type: :datetime, readonly: true},
6
+ updated_at: {type: :datetime, readonly: true},
7
+ rate: {type: :decimal},
8
+ source: {type: :string },
9
+ flat_rate: {type: :boolean},
10
+ user_id: {type: :int},
11
+ )
12
+
13
+
14
+ end
15
+
16
+ end
@@ -0,0 +1,11 @@
1
+ module ClioClient
2
+
3
+ class Reminder < Resource
4
+
5
+ set_attributes(minutes: {type: :int },
6
+ method: {type: :string }
7
+ )
8
+
9
+ end
10
+
11
+ end
@@ -0,0 +1,12 @@
1
+ module ClioClient
2
+ class WebSite < Resource
3
+
4
+ set_attributes(id: {type: :int, readonly: true},
5
+ created_at: {type: :datetime, readonly: true},
6
+ updated_at: {type: :datetime, readonly: true},
7
+ name: {type: :string},
8
+ address: {type: :string},
9
+ )
10
+
11
+ end
12
+ end
@@ -0,0 +1,3 @@
1
+ module ClioClient
2
+ VERSION = "0.0.1"
3
+ end
@@ -0,0 +1,107 @@
1
+ require 'net/http'
2
+ require 'json'
3
+
4
+ module ClioClient
5
+
6
+ { :Session => 'session',
7
+ :Base => 'base',
8
+ :Resource => 'resource',
9
+ :Http => 'http',
10
+ :Authorization => 'authorization'
11
+ }.each_pair do |klass, file|
12
+ autoload klass, "clio_client/#{file}"
13
+ end
14
+
15
+ # Models
16
+ {
17
+ :Account => 'account',
18
+ :Activity => 'activity',
19
+ :ActivityDescription => 'activity_description',
20
+ :Bill => 'bill',
21
+ :CalendarEntry => 'calendar_entry',
22
+ :Calendar => 'calendar',
23
+ :Communication => 'communication',
24
+ :Company => 'company',
25
+ :Contact => 'contact',
26
+ :CustomFieldSet => 'custom_field_set',
27
+ :CustomField => 'custom_field',
28
+ :DocumentVersion => 'document_version',
29
+ :Document => 'document',
30
+ :ExpenseEntry => 'expense_entry',
31
+ :EmailCommunication => 'email_communication',
32
+ :Group => 'group',
33
+ :Matter => 'matter',
34
+ :Note => 'note',
35
+ :Person => 'person',
36
+ :PhoneCommunication => 'phone_communication',
37
+ :PracticeArea => 'practice_area',
38
+ :TimeEntry => 'time_entry',
39
+ :Relationship => 'relationship',
40
+ :Task => 'task',
41
+ :TimelineEvent => 'timeline_event',
42
+ :Timer => 'timer',
43
+ :User => 'user'
44
+ }.each_pair do |klass, file|
45
+ autoload klass, "clio_client/models/#{file}"
46
+ end
47
+
48
+ {
49
+ :PhoneNumber => 'phone_number',
50
+ :EmailAddress => 'email_address',
51
+ :Address => 'address',
52
+ :WebSite => 'web_site',
53
+ :InstantMessenger => 'instant_messenger',
54
+ :CustomFieldValue => 'custom_field_value',
55
+ :CustomFieldCheckboxValue => 'custom_field_checkbox_value',
56
+ :CustomFieldContactValue => 'custom_field_contact_value',
57
+ :CustomFieldCurrencyValue => 'custom_field_currency_value',
58
+ :CustomFieldDateValue => 'custom_field_date_value',
59
+ :CustomFieldTimeValue => 'custom_field_time_value',
60
+ :CustomFieldEmailValue => 'custom_field_email_value',
61
+ :CustomFieldMatterValue => 'custom_field_matter_value',
62
+ :CustomFieldNumericValue => 'custom_field_numeric_value',
63
+ :CustomFieldPicklistValue => 'custom_field_picklist_value',
64
+ :CustomFieldPicklistOption =>'custom_field_picklist_option',
65
+ :CustomFieldTextAreaValue => 'custom_field_text_area_value',
66
+ :CustomFieldTextLineValue => 'custom_field_text_line_value',
67
+ :CustomFieldUrlValue => 'custom_field_url_value',
68
+ :Rate => 'rate',
69
+ :Reminder => 'reminder'
70
+ }.each_pair do |klass, file|
71
+ autoload klass, "clio_client/support/#{file}"
72
+ end
73
+
74
+ module Api
75
+ {
76
+ :Base => 'base',
77
+ :Activity => 'activity',
78
+ :ActivityDescription =>'activity_description',
79
+ :Bill => 'bill',
80
+ :CalendarEntry => 'calendar_entry',
81
+ :Calendar => 'calendar',
82
+ :Communication => 'communication',
83
+ :Contact => 'contact',
84
+ :CustomFieldSet => 'custom_field_set',
85
+ :CustomField => 'custom_field',
86
+ :DocumentVersion => 'document_version',
87
+ :Document => 'document',
88
+ :Group => 'group',
89
+ :Matter => 'matter',
90
+ :Note => 'note',
91
+ :PracticeArea => 'practice_area',
92
+ :Relationship => 'relationship',
93
+ :Task => 'task',
94
+ :TimelineEvent => 'timeline_event',
95
+ :Timer => 'timer',
96
+ :User => 'user',
97
+
98
+ :Crudable => 'crudable',
99
+ :Findable => 'findable',
100
+ :Listable => 'listable'
101
+ }.each_pair do |klass, file|
102
+ autoload klass, "clio_client/api/#{file}"
103
+ end
104
+
105
+ end
106
+
107
+ end
@@ -0,0 +1,54 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::Api::Crudable do
4
+ let(:session) { double("ClioClient::Api::Session") }
5
+ subject {
6
+ d = DummyEndpoint.new(session)
7
+ d.extend(ClioClient::Api::Crudable)
8
+ d
9
+ }
10
+
11
+ describe "#new" do
12
+ it "returns the correct data items" do
13
+ record = subject.new({ int: "1" })
14
+ expect(record).to be_kind_of TestResource
15
+ expect(record.int).to eql 1
16
+ end
17
+ end
18
+
19
+ describe "#create" do
20
+ let(:params) { { string: "1" } }
21
+ let(:response) do
22
+ { "dummy" => { string: "1" } }
23
+ end
24
+
25
+ it "issues with create request" do
26
+ session.stub(:post).with("test", {"dummy" => params}.to_json).and_return(response)
27
+ record = subject.create(params)
28
+ expect(record).to be_kind_of TestResource
29
+ expect(record.string).to eql "1"
30
+ end
31
+ end
32
+
33
+ describe "#update" do
34
+ let(:params) { { id: 1, string: "1" } }
35
+ let(:response) do
36
+ { "dummy" => { id: 1, string: "1" } }
37
+ end
38
+
39
+ it "issues with update request" do
40
+ record = session.stub(:put).with("test/1", {"dummy" => params}.to_json).and_return(response)
41
+ record = subject.update("1", params)
42
+ expect(record).to be_kind_of TestResource
43
+ expect(record.string).to eql "1"
44
+ end
45
+ end
46
+
47
+ describe "#destroy" do
48
+ it "issues a delete request" do
49
+ session.should_receive(:delete)
50
+ subject.destroy(1)
51
+ end
52
+ end
53
+
54
+ end
@@ -0,0 +1,25 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::Api::Findable do
4
+ let(:session) { double("ClioClient::Api::Session") }
5
+ subject {
6
+ d = DummyEndpoint.new(session)
7
+ d.extend(ClioClient::Api::Findable)
8
+ d
9
+ }
10
+
11
+ describe "#find" do
12
+ let(:response) do
13
+ { "dummy" => { "id" => 1 }}
14
+ end
15
+
16
+ it "should return the correct data item" do
17
+ session.stub(:get).and_return(response)
18
+ dummy = subject.find(1)
19
+ expect(dummy).to be_kind_of TestResource
20
+ expect(dummy.id).to eql 1
21
+ end
22
+
23
+ end
24
+
25
+ end
@@ -0,0 +1,27 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::Api::Listable do
4
+ let(:session) { double("ClioClient::Api::Session") }
5
+ subject {
6
+ d = DummyEndpoint.new(session)
7
+ d.extend(ClioClient::Api::Listable)
8
+ d
9
+ }
10
+
11
+ describe "#find" do
12
+ let(:response) do
13
+ { "dummies" => [{ id: 1 }, { id: 2} ]}
14
+ end
15
+
16
+ it "should return the correct data items" do
17
+ session.stub(:get).and_return(response)
18
+ records = subject.list
19
+ expect(records.count).to eql 2
20
+ expect(records.first).to be_kind_of TestResource
21
+ expect(records.first.id).to eql 1
22
+ expect(records.last.id).to eql 2
23
+ end
24
+
25
+ end
26
+
27
+ end
@@ -0,0 +1,35 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::Api::Activity, :external => true do
4
+
5
+ let(:session) { ClioClient::Session.new(:access_token => ENV['ACCESS_TOKEN']) }
6
+ let(:api) { session.activities }
7
+
8
+ let(:params) do
9
+ {
10
+ type: "TimeEntry",
11
+ quantity: 3600,
12
+ price: 10.0,
13
+ date: '2013-01-01'
14
+ }
15
+ end
16
+
17
+ let(:changed_field) { :note }
18
+ let(:changed_value) { "Magic Value" }
19
+
20
+ it "is crudable" do
21
+ item = api.create(params)
22
+ stored_item = api.find(item.id)
23
+ expect(item).to eql stored_item
24
+
25
+ item = api.update(item.id, {changed_field => changed_value})
26
+ expect(item[changed_field]).to eql changed_value
27
+
28
+ api.destroy(item.id)
29
+
30
+ expect(api.find(item.id)).to be_nil
31
+ end
32
+
33
+
34
+
35
+ end
@@ -0,0 +1,12 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::Account do
4
+
5
+ context "owner association" do
6
+ let(:attribute) { :owner }
7
+ let(:klass) { ClioClient::User }
8
+ include_examples "association"
9
+ end
10
+
11
+
12
+ end
@@ -0,0 +1,47 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::ActivityDescription do
4
+
5
+ context "when initialized with the example attributes" do
6
+ let(:params) do
7
+ {
8
+ "id" => "1",
9
+ "name" => "Phone Call",
10
+ "created_at" => "2013-12-03T23:35:36+00:00",
11
+ "updated_at" => "2013-12-03T23:35:36+00:00",
12
+ "activity_rate_default" => nil,
13
+ "rates" => [
14
+ {
15
+ "user_id" => "1",
16
+ "rate" => "700.0",
17
+ "source" => "user",
18
+ "flat_rate" => "false"
19
+ },
20
+ {
21
+ "user_id" => "2",
22
+ "rate" => "650.0",
23
+ "source" => "user",
24
+ "flat_rate" => "false"
25
+ },
26
+ {
27
+ "user_id" => "3",
28
+ "rate" => "600.0",
29
+ "source" => "user",
30
+ "flat_rate" => "false"
31
+ }
32
+ ]
33
+ }
34
+
35
+ end
36
+ include_examples "model initialization"
37
+
38
+ end
39
+
40
+ context "rates association" do
41
+ let(:association_params) { {"name" => nil, "rate" => 1.0, "source" => "a" }}
42
+ let(:attribute) { :rates }
43
+ let(:klass) { ClioClient::Rate }
44
+ include_examples "has many association"
45
+ end
46
+
47
+ end
@@ -0,0 +1,29 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::Activity do
4
+
5
+ context "user association" do
6
+ let(:attribute) { :user }
7
+ let(:klass) { ClioClient::User }
8
+ include_examples "association"
9
+ end
10
+
11
+ context "matter association" do
12
+ let(:attribute) { :matter }
13
+ let(:klass) { ClioClient::Matter }
14
+ include_examples "association"
15
+ end
16
+
17
+ context "activity description association" do
18
+ let(:attribute) { :activity_description }
19
+ let(:klass) { ClioClient::ActivityDescription }
20
+ include_examples "association"
21
+ end
22
+
23
+ context "communication association" do
24
+ let(:attribute) { :communication }
25
+ let(:klass) { ClioClient::Communication }
26
+ include_examples "association"
27
+ end
28
+
29
+ end
@@ -0,0 +1,63 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::Bill do
4
+
5
+ context "when initialized with the example attributes" do
6
+ let(:params) do
7
+ {
8
+ "id" => "1",
9
+ "pdf_url" => "/api/v2/bills/1.pdf",
10
+ "number" => "1148",
11
+ "subject" => nil,
12
+ "currency" => "USD",
13
+ "purchase_order" => nil,
14
+ "memo" => nil,
15
+ "start_at" => nil,
16
+ "end_at" => nil,
17
+ "issued_at" => "2013-07-27",
18
+ "due_at" => "2013-08-26",
19
+ "type" => "Bill",
20
+ "original_bill_id" => nil,
21
+ "tax_rate" => "0.0",
22
+ "secondary_tax_rate" => "0.0",
23
+ "discount" => "0.0",
24
+ "discount_type" => nil,
25
+ "discount_note" => nil,
26
+ "balance" => "1075.0",
27
+ "total" => "1075.0",
28
+ "status" => "Past Due",
29
+ "matters" => [
30
+ {
31
+ "id" => "5",
32
+ "url" => "/api/v2/matters/5",
33
+ "name" => "00005-Marvin, Rohan and Block"
34
+ }
35
+ ],
36
+ "client" => {
37
+ "id" => "1",
38
+ "url" => "/api/v2/contacts/1",
39
+ "name" => "Pacocha-Bode"
40
+ },
41
+ "created_at" => "2013-12-03T23:35:39+00:00",
42
+ "updated_at" => "2013-12-03T23:35:41+00:00"
43
+ }
44
+
45
+ end
46
+ include_examples "model initialization"
47
+
48
+ end
49
+
50
+ context "client association" do
51
+ let(:attribute) { :client }
52
+ let(:klass) { ClioClient::Contact }
53
+ include_examples "association"
54
+ end
55
+
56
+
57
+ context "matters association" do
58
+ let(:attribute) { :matters }
59
+ let(:klass) { ClioClient::Matter }
60
+ include_examples "has many association"
61
+ end
62
+
63
+ end
@@ -0,0 +1,62 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::CalendarEntry do
4
+
5
+ context "when initialized with the example attributes" do
6
+ let(:params) do
7
+ {
8
+ "id" => "5",
9
+ "recurrence_rule" => nil,
10
+ "parent_calendar_entry_id" => nil,
11
+ "created_at" => "2013-12-03T23:35:34+00:00",
12
+ "updated_at" => "2013-12-03T23:35:34+00:00",
13
+ "calendar" => {
14
+ "id" => "1",
15
+ "url" => "/api/v2/calendars/1",
16
+ "name" => "Firm"
17
+ },
18
+ "attending_calendars" => [
19
+
20
+ ],
21
+ "start_date" => "2014-03-05",
22
+ "end_date" => "2014-03-06",
23
+ "original_event_start_date" => nil,
24
+ "permission" => "owner",
25
+ "summary" => "Tenetur adipisci dolorem unde suscipit at qui nam.",
26
+ "description" => "Aut laborum nihil. Necessitatibus quae voluptatem quia velit et. Illo asperiores et. Nostrum deserunt veritatis qui hic ut.",
27
+ "location" => nil,
28
+ "matter" => nil,
29
+ "reminders" => [
30
+
31
+ ]
32
+ }
33
+ end
34
+ include_examples "model initialization"
35
+
36
+ end
37
+
38
+
39
+ context "matter association" do
40
+ let(:attribute) { :matter }
41
+ let(:klass) { ClioClient::Matter }
42
+ include_examples "association"
43
+ end
44
+ context "matter association" do
45
+ let(:attribute) { :calendar }
46
+ let(:klass) { ClioClient::Calendar }
47
+ include_examples "association"
48
+ end
49
+ context "matter association" do
50
+ let(:attribute) { :attending_calendars }
51
+ let(:klass) { ClioClient::Calendar }
52
+ include_examples "has many association"
53
+ end
54
+ context "matter association" do
55
+ let(:attribute) { :reminders }
56
+ let(:klass) { ClioClient::Reminder }
57
+ let(:association_params) { {"id" => nil, "name" => nil, "minutes" => 1, "method" => "popup" }}
58
+ include_examples "has many association"
59
+ end
60
+
61
+
62
+ end
@@ -0,0 +1,20 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::Calendar do
4
+ context "when initialized with the example attributes" do
5
+ let(:params) do
6
+ {
7
+ "id" => "1",
8
+ "name" => "Firm",
9
+ "type" => "AccountCalendar",
10
+ "created_at" => "2013-12-03T23:35:26+00:00",
11
+ "updated_at" => "2013-12-03T23:35:36+00:00",
12
+ "permission" => "owner",
13
+ "color" => "#da6666"
14
+ }
15
+ end
16
+
17
+ include_examples "model initialization"
18
+
19
+ end
20
+ end
@@ -0,0 +1,39 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::Communication do
4
+
5
+ context "matter association" do
6
+ let(:attribute) { :matter }
7
+ let(:klass) { ClioClient::Matter }
8
+ include_examples "association"
9
+ end
10
+
11
+ context "senders association with a contact" do
12
+ let(:attribute) { :senders }
13
+ let(:klass) { ClioClient::Contact }
14
+ let(:association_params) { {"type" => "Contact" }}
15
+ include_examples "has many association"
16
+ end
17
+
18
+ context "senders association with a user" do
19
+ let(:attribute) { :senders }
20
+ let(:klass) { ClioClient::User }
21
+ let(:association_params) { {"type" => "User" }}
22
+ include_examples "has many association"
23
+ end
24
+
25
+ context "receivers association with a contact" do
26
+ let(:attribute) { :receivers }
27
+ let(:klass) { ClioClient::Contact }
28
+ let(:association_params) { {"type" => "Contact" }}
29
+ include_examples "has many association"
30
+ end
31
+
32
+ context "receivers association with a user" do
33
+ let(:attribute) { :receivers }
34
+ let(:klass) { ClioClient::User }
35
+ let(:association_params) { {"type" => "User" }}
36
+ include_examples "has many association"
37
+ end
38
+
39
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::Company do
4
+
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::Contact do
4
+
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::CustomFieldSet do
4
+
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::CustomField do
4
+
5
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::Document do
4
+
5
+ end
@@ -0,0 +1,6 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::DocumentVersion do
4
+
5
+
6
+ end
@@ -0,0 +1,6 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::EmailCommunication do
4
+
5
+
6
+ end
@@ -0,0 +1,5 @@
1
+ require 'spec_helper'
2
+
3
+ describe ClioClient::ExpenseEntry do
4
+
5
+ end