avvo_api 0.1.0

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.
@@ -0,0 +1,22 @@
1
+ require 'test_helper'
2
+
3
+ class AvvoApi::PhoneTest < Test::Unit::TestCase
4
+
5
+ context "AvvoApi::Phone" do
6
+ should "belong_to :address" do
7
+ assert_contains(AvvoApi::Phone.belongs_to_associations.map(&:attribute), :address)
8
+ end
9
+
10
+ should "build successfully with PhoneType constants" do
11
+ phone = AvvoApi::Phone.new(:phone_number => '2125551212', :phone_type_id => AvvoApi::PhoneType::OFFICE, :address_id => 1, :lawyer_id => 1)
12
+ assert_equal 2, phone.phone_type_id
13
+ end
14
+
15
+ should "be able to return a reasonable string for a phone type id" do
16
+ stub_request(:get, "https://test_account%40avvo.com:password@api.avvo.com/api/1/lawyers/1/addresses/1/phones/1.json").to_return(:body => {:id => 1, :phone_number => '212-555-1212', :phone_type => 'Office', :updated_at => Time.now}.to_json)
17
+ phone = AvvoApi::Phone.find(1, :params => {:lawyer_id => 1, :address_id => 1})
18
+ assert_equal "Office", phone.phone_type
19
+ end
20
+ end
21
+
22
+ end
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+
3
+ class AvvoApi::ReviewTest < Test::Unit::TestCase
4
+
5
+ context "AvvoApi::Review" do
6
+ should "belong_to :lawyer" do
7
+ assert_contains(AvvoApi::Review.belongs_to_associations.map(&:attribute), :lawyer)
8
+ end
9
+ should "belong_to :doctor" do
10
+ assert_contains(AvvoApi::Review.belongs_to_associations.map(&:attribute), :doctor)
11
+ end
12
+ end
13
+
14
+ end
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+
3
+ class AvvoApi::SchoolTest < Test::Unit::TestCase
4
+
5
+ context "AvvoApi::School" do
6
+ should "belong_to :lawyer" do
7
+ assert_contains(AvvoApi::School.belongs_to_associations.map(&:attribute), :lawyer)
8
+ end
9
+ should "belong_to :doctor" do
10
+ assert_contains(AvvoApi::School.belongs_to_associations.map(&:attribute), :doctor)
11
+ end
12
+ end
13
+
14
+ end
@@ -0,0 +1,14 @@
1
+ require 'test_helper'
2
+
3
+ class AvvoApi::SpecialtyTest < Test::Unit::TestCase
4
+
5
+ context "AvvoApi::Specialty" do
6
+ should "belong_to :lawyer" do
7
+ assert_contains(AvvoApi::Specialty.belongs_to_associations.map(&:attribute), :lawyer)
8
+ end
9
+ should "belong_to :doctor" do
10
+ assert_contains(AvvoApi::Specialty.belongs_to_associations.map(&:attribute), :doctor)
11
+ end
12
+ end
13
+
14
+ end
metadata ADDED
@@ -0,0 +1,154 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: avvo_api
3
+ version: !ruby/object:Gem::Version
4
+ prerelease: false
5
+ segments:
6
+ - 0
7
+ - 1
8
+ - 0
9
+ version: 0.1.0
10
+ platform: ruby
11
+ authors:
12
+ - Justin Weiss
13
+ autorequire:
14
+ bindir: bin
15
+ cert_chain: []
16
+
17
+ date: 2011-01-28 00:00:00 -08:00
18
+ default_executable:
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: reactive_resource
22
+ requirement: &id001 !ruby/object:Gem::Requirement
23
+ none: false
24
+ requirements:
25
+ - - ~>
26
+ - !ruby/object:Gem::Version
27
+ segments:
28
+ - 0
29
+ - 5
30
+ - 0
31
+ version: 0.5.0
32
+ type: :runtime
33
+ prerelease: false
34
+ version_requirements: *id001
35
+ - !ruby/object:Gem::Dependency
36
+ name: shoulda
37
+ requirement: &id002 !ruby/object:Gem::Requirement
38
+ none: false
39
+ requirements:
40
+ - - ~>
41
+ - !ruby/object:Gem::Version
42
+ segments:
43
+ - 2
44
+ - 11
45
+ - 3
46
+ version: 2.11.3
47
+ type: :development
48
+ prerelease: false
49
+ version_requirements: *id002
50
+ - !ruby/object:Gem::Dependency
51
+ name: webmock
52
+ requirement: &id003 !ruby/object:Gem::Requirement
53
+ none: false
54
+ requirements:
55
+ - - ~>
56
+ - !ruby/object:Gem::Version
57
+ segments:
58
+ - 1
59
+ - 6
60
+ - 1
61
+ version: 1.6.1
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: *id003
65
+ description: An ActiveResource client to the Avvo API
66
+ email:
67
+ - jweiss@avvo.com
68
+ executables: []
69
+
70
+ extensions: []
71
+
72
+ extra_rdoc_files: []
73
+
74
+ files:
75
+ - .gitignore
76
+ - Gemfile
77
+ - Gemfile.lock
78
+ - README.rdoc
79
+ - Rakefile
80
+ - avvo_api.gemspec
81
+ - examples/avvo_cli.rb
82
+ - lib/avvo_api.rb
83
+ - lib/avvo_api/address.rb
84
+ - lib/avvo_api/advanced_training.rb
85
+ - lib/avvo_api/base.rb
86
+ - lib/avvo_api/doctor.rb
87
+ - lib/avvo_api/headshot.rb
88
+ - lib/avvo_api/language.rb
89
+ - lib/avvo_api/lawyer.rb
90
+ - lib/avvo_api/phone.rb
91
+ - lib/avvo_api/professional_methods.rb
92
+ - lib/avvo_api/review.rb
93
+ - lib/avvo_api/school.rb
94
+ - lib/avvo_api/specialty.rb
95
+ - lib/avvo_api/version.rb
96
+ - test/test_helper.rb
97
+ - test/unit/address_test.rb
98
+ - test/unit/advanced_training_test.rb
99
+ - test/unit/base_test.rb
100
+ - test/unit/doctor_test.rb
101
+ - test/unit/headshot_test.rb
102
+ - test/unit/language_test.rb
103
+ - test/unit/lawyer_test.rb
104
+ - test/unit/phone_test.rb
105
+ - test/unit/review_test.rb
106
+ - test/unit/school_test.rb
107
+ - test/unit/specialty_test.rb
108
+ has_rdoc: true
109
+ homepage: http://api.avvo.com
110
+ licenses: []
111
+
112
+ post_install_message:
113
+ rdoc_options: []
114
+
115
+ require_paths:
116
+ - lib
117
+ required_ruby_version: !ruby/object:Gem::Requirement
118
+ none: false
119
+ requirements:
120
+ - - ">="
121
+ - !ruby/object:Gem::Version
122
+ hash: 3180214773619450894
123
+ segments:
124
+ - 0
125
+ version: "0"
126
+ required_rubygems_version: !ruby/object:Gem::Requirement
127
+ none: false
128
+ requirements:
129
+ - - ">="
130
+ - !ruby/object:Gem::Version
131
+ hash: 3180214773619450894
132
+ segments:
133
+ - 0
134
+ version: "0"
135
+ requirements: []
136
+
137
+ rubyforge_project: avvo_api
138
+ rubygems_version: 1.3.7
139
+ signing_key:
140
+ specification_version: 3
141
+ summary: An ActiveResource client to the Avvo API
142
+ test_files:
143
+ - test/test_helper.rb
144
+ - test/unit/address_test.rb
145
+ - test/unit/advanced_training_test.rb
146
+ - test/unit/base_test.rb
147
+ - test/unit/doctor_test.rb
148
+ - test/unit/headshot_test.rb
149
+ - test/unit/language_test.rb
150
+ - test/unit/lawyer_test.rb
151
+ - test/unit/phone_test.rb
152
+ - test/unit/review_test.rb
153
+ - test/unit/school_test.rb
154
+ - test/unit/specialty_test.rb