fullcontacter 0.3.2

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 (74) hide show
  1. data/.document +5 -0
  2. data/.gitignore +53 -0
  3. data/.rspec +3 -0
  4. data/Gemfile +3 -0
  5. data/LICENSE.md +20 -0
  6. data/README.md +36 -0
  7. data/Rakefile +25 -0
  8. data/VERSION +1 -0
  9. data/bugs.txt +2 -0
  10. data/fullcontact.gemspec +34 -0
  11. data/lib/faraday/request/gateway.rb +18 -0
  12. data/lib/faraday/response/fullcontact_errors.rb +33 -0
  13. data/lib/faraday/response/raise_http_4xx.rb +45 -0
  14. data/lib/faraday/response/raise_http_5xx.rb +24 -0
  15. data/lib/fullcontact.rb +27 -0
  16. data/lib/fullcontact/api.rb +21 -0
  17. data/lib/fullcontact/client.rb +32 -0
  18. data/lib/fullcontact/client/batch_process.rb +35 -0
  19. data/lib/fullcontact/client/contact.rb +119 -0
  20. data/lib/fullcontact/client/contact_list.rb +84 -0
  21. data/lib/fullcontact/client/icon.rb +35 -0
  22. data/lib/fullcontact/client/name.rb +167 -0
  23. data/lib/fullcontact/client/person.rb +94 -0
  24. data/lib/fullcontact/client/provisioning.rb +28 -0
  25. data/lib/fullcontact/client/snapshot.rb +31 -0
  26. data/lib/fullcontact/client/subscription.rb +45 -0
  27. data/lib/fullcontact/client/user.rb +28 -0
  28. data/lib/fullcontact/configuration.rb +95 -0
  29. data/lib/fullcontact/connection.rb +36 -0
  30. data/lib/fullcontact/error.rb +35 -0
  31. data/lib/fullcontact/request.rb +43 -0
  32. data/lib/fullcontact/version.rb +3 -0
  33. data/spec/faraday/response_spec.rb +56 -0
  34. data/spec/fixtures/clear_contact_list.json +3 -0
  35. data/spec/fixtures/contact_history.json +16 -0
  36. data/spec/fixtures/create_contact_list.json +4 -0
  37. data/spec/fixtures/create_snapshot.json +7 -0
  38. data/spec/fixtures/create_subscription.json +4 -0
  39. data/spec/fixtures/deduce_by_email.json +13 -0
  40. data/spec/fixtures/deduce_by_username.json +13 -0
  41. data/spec/fixtures/delete_contact.json +4 -0
  42. data/spec/fixtures/delete_contact_list.json +3 -0
  43. data/spec/fixtures/delete_subscription.json +3 -0
  44. data/spec/fixtures/get_contact.json +20 -0
  45. data/spec/fixtures/get_contact_lists.json +11 -0
  46. data/spec/fixtures/get_contacts_in_a_list.json +41 -0
  47. data/spec/fixtures/get_enriched_contact.json +261 -0
  48. data/spec/fixtures/get_updates.json +252 -0
  49. data/spec/fixtures/has_enriched_updates.json +4 -0
  50. data/spec/fixtures/list_snapshots.json +7 -0
  51. data/spec/fixtures/list_subscriptions.json +10 -0
  52. data/spec/fixtures/normalize.json +27 -0
  53. data/spec/fixtures/parse.json +10 -0
  54. data/spec/fixtures/person.json +47 -0
  55. data/spec/fixtures/queue_contact_list_for_enrichment.json +3 -0
  56. data/spec/fixtures/save_enriched_contact.json +261 -0
  57. data/spec/fixtures/similarity.json +45 -0
  58. data/spec/fixtures/stats_by_family_name.json +12 -0
  59. data/spec/fixtures/stats_by_given_and_family_name.json +62 -0
  60. data/spec/fixtures/stats_by_given_name.json +57 -0
  61. data/spec/fixtures/stats_by_name.json +64 -0
  62. data/spec/fixtures/update_contact.json +9 -0
  63. data/spec/fullcontact/api_spec.rb +68 -0
  64. data/spec/fullcontact/client/contact_list_spec.rb +89 -0
  65. data/spec/fullcontact/client/contact_spec.rb +108 -0
  66. data/spec/fullcontact/client/icon_spec.rb +24 -0
  67. data/spec/fullcontact/client/name_spec.rb +121 -0
  68. data/spec/fullcontact/client/person_spec.rb +77 -0
  69. data/spec/fullcontact/client/snapshot_spec.rb +35 -0
  70. data/spec/fullcontact/client/subscription_spec.rb +47 -0
  71. data/spec/fullcontact/client_spec.rb +10 -0
  72. data/spec/fullcontact_spec.rb +114 -0
  73. data/spec/helper.rb +39 -0
  74. metadata +384 -0
@@ -0,0 +1,57 @@
1
+ {
2
+ "status": 200,
3
+ "name": {
4
+ "value": "John",
5
+ "given": {
6
+ "count": 3499150,
7
+ "rank": 3,
8
+ "male": {
9
+ "count": 3484136,
10
+ "likelihood": 0.996,
11
+ "rank": 3,
12
+ "frequencyRatio": "0.026305137",
13
+ "age": {
14
+ "densityCurve": {
15
+ "mode": {
16
+ "count": 77174,
17
+ "modeAge":
18
+ [
19
+ 47
20
+ ]
21
+ },
22
+ "meanAge": 51.2,
23
+ "quartiles": {
24
+ "q1": 35.3,
25
+ "q2": 50.5,
26
+ "q3": 62.9
27
+ }
28
+ }
29
+ }
30
+ },
31
+ "female": {
32
+ "count": 15015,
33
+ "likelihood": 0.004,
34
+ "rank": 928,
35
+ "frequencyRatio": "0.00011386",
36
+ "age": {
37
+ "densityCurve": {
38
+ "mode": {
39
+ "count": 297,
40
+ "modeAge":
41
+ [
42
+ 43
43
+ ]
44
+ },
45
+ "meanAge": 48.5,
46
+ "quartiles": {
47
+ "q1": 34.8,
48
+ "q2": 49.4,
49
+ "q3": 69.4
50
+ }
51
+ }
52
+ }
53
+ }
54
+ }
55
+ },
56
+ "region": "USA"
57
+ }
@@ -0,0 +1,64 @@
1
+ {
2
+ "status": 200,
3
+ "name": {
4
+ "value": "John",
5
+ "given": {
6
+ "likelihood": 0.992,
7
+ "count": 3499150,
8
+ "rank": 3,
9
+ "male": {
10
+ "count": 3484136,
11
+ "likelihood": 0.996,
12
+ "rank": 3,
13
+ "frequencyRatio": "0.026305137",
14
+ "age": {
15
+ "densityCurve": {
16
+ "mode": {
17
+ "count": 77174,
18
+ "modeAge":
19
+ [
20
+ 47
21
+ ]
22
+ },
23
+ "meanAge": 51.2,
24
+ "quartiles": {
25
+ "q1": 35.3,
26
+ "q2": 50.5,
27
+ "q3": 62.9
28
+ }
29
+ }
30
+ }
31
+ },
32
+ "female": {
33
+ "count": 15015,
34
+ "likelihood": 0.004,
35
+ "rank": 928,
36
+ "frequencyRatio": "0.00011386",
37
+ "age": {
38
+ "densityCurve": {
39
+ "mode": {
40
+ "count": 297,
41
+ "modeAge":
42
+ [
43
+ 43
44
+ ]
45
+ },
46
+ "meanAge": 48.5,
47
+ "quartiles": {
48
+ "q1": 34.8,
49
+ "q2": 49.4,
50
+ "q3": 69.4
51
+ }
52
+ }
53
+ }
54
+ }
55
+ },
56
+ "family": {
57
+ "likelihood": 0.008,
58
+ "count": 27643,
59
+ "rank": 1161,
60
+ "frequencyRatio": "0.00011417"
61
+ }
62
+ },
63
+ "region": "USA"
64
+ }
@@ -0,0 +1,9 @@
1
+ {
2
+ "results": [
3
+ {
4
+ "contactId": "jzZrFNsv5s",
5
+ "eTag": "fffffec9d69df08ded1d2009fc32d0a397820a5482306589e6c09b05"
6
+ }
7
+ ],
8
+ "status": 200
9
+ }
@@ -0,0 +1,68 @@
1
+ require 'helper'
2
+
3
+ describe FullContact::API do
4
+ before do
5
+ @keys = FullContact::Configuration::VALID_OPTIONS_KEYS
6
+ end
7
+
8
+ context "with module configuration" do
9
+ before do
10
+ FullContact.configure do |config|
11
+ @keys.each do |key|
12
+ config.send("#{key}=", key)
13
+ end
14
+ end
15
+ end
16
+
17
+ after do
18
+ FullContact.reset
19
+ end
20
+
21
+ it "should inherit module configuration" do
22
+ api = FullContact::API.new
23
+ @keys.each do |key|
24
+ api.send(key).should == key
25
+ end
26
+ end
27
+
28
+ context "with class configuration" do
29
+
30
+ before do
31
+ @configuration = {
32
+ :access_token => '23234e23',
33
+ :account_key => 'account key',
34
+ :adapter => :typhoeus,
35
+ :api_key => 'api_key',
36
+ :endpoint => 'http://tumblr.com/',
37
+ :gateway => 'apigee-1111.apigee.com',
38
+ :get_request_url_only => false,
39
+ :format => :xml,
40
+ :proxy => 'http://erik:sekret@proxy.example.com:8080',
41
+ :user_agent => 'Custom User Agent',
42
+ }
43
+ end
44
+
45
+ context "during initialization"
46
+
47
+ it "should override module configuration" do
48
+ api = FullContact::API.new(@configuration)
49
+ @keys.each do |key|
50
+ api.send(key).should == @configuration[key]
51
+ end
52
+ end
53
+
54
+ context "after initilization" do
55
+
56
+ it "should override module configuration after initialization" do
57
+ api = FullContact::API.new
58
+ @configuration.each do |key, value|
59
+ api.send("#{key}=", value)
60
+ end
61
+ @keys.each do |key|
62
+ api.send(key).should == @configuration[key]
63
+ end
64
+ end
65
+ end
66
+ end
67
+ end
68
+ end
@@ -0,0 +1,89 @@
1
+ require 'helper'
2
+ require 'fullcontact'
3
+
4
+ describe FullContact::Client::ContactList do
5
+
6
+ before do
7
+ FullContact.configure do |config|
8
+ config.api_key = "api_key"
9
+ end
10
+ @client = FullContact::Client.new
11
+ end
12
+
13
+ describe "#create_contact_list" do
14
+ before do
15
+ stub_post("contactLists.json").
16
+ with(:query => { :apiKey => "api_key" }).
17
+ to_return(:body => fixture("create_contact_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
18
+ end
19
+ it "should send a post to contactLists" do
20
+ @client.create_contact_list
21
+ a_post("contactLists.json").with(:query => { :apiKey => "api_key" }).should have_been_made
22
+ end
23
+ end
24
+
25
+ describe "#delete_contact_list" do
26
+ before do
27
+ stub_delete("contactLists/12345.json").
28
+ with(:query => { :apiKey => "api_key"}).
29
+ to_return(:body => fixture("delete_contact_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
30
+ end
31
+
32
+ it "should send a delete to contactLists" do
33
+ @client.delete_contact_list("12345")
34
+ a_delete("contactLists/12345.json").with(:query => { :apiKey => "api_key" }).should have_been_made
35
+ end
36
+ end
37
+
38
+ describe "#get_contact_lists" do
39
+ before do
40
+ stub_get("contactLists.json").
41
+ with(:query => { :apiKey => "api_key"}).
42
+ to_return(:body => fixture("get_contact_lists.json"), :headers => {:content_type => "application/json; charset=utf-8"})
43
+ end
44
+
45
+ it "should get the list of contact lists" do
46
+ @client.get_contact_lists
47
+ a_get("contactLists.json").with(:query => { :apiKey => "api_key" }).should have_been_made
48
+ end
49
+ end
50
+
51
+ describe "#get_contacts_in_a_list" do
52
+ before do
53
+ stub_get("contactLists/12345.json").
54
+ with(:query => { :apiKey => "api_key"}).
55
+ to_return(:body => fixture("get_contacts_in_a_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
56
+ end
57
+
58
+ it "should get the contacts in a list" do
59
+ @client.get_contacts_in_a_list(12345)
60
+ a_get("contactLists/12345.json").with(:query => { :apiKey => "api_key" }).should have_been_made
61
+ end
62
+ end
63
+
64
+ describe "#queue_contact_list_for_enrichment" do
65
+ before do
66
+ stub_post("contactLists/12345/queue.json").
67
+ with(:query => { :apiKey => "api_key"}).
68
+ to_return(:body => fixture("queue_contact_list_for_enrichment.json"), :headers => {:content_type => "application/json; charset=utf-8"})
69
+ end
70
+
71
+ it "should queue the contact list for enrichment" do
72
+ @client.queue_contact_list_for_enrichment("12345")
73
+ a_post("contactLists/12345/queue.json").with(:query => { :apiKey => "api_key" }).should have_been_made
74
+ end
75
+ end
76
+
77
+ describe "#clear_contact_list" do
78
+ before do
79
+ stub_post("contactLists/12345/clear.json").
80
+ with(:query => { :apiKey => "api_key"}).
81
+ to_return(:body => fixture("clear_contact_list.json"), :headers => {:content_type => "application/json; charset=utf-8"})
82
+ end
83
+
84
+ it "should clear the contacts in a list" do
85
+ @client.clear_contact_list("12345")
86
+ a_post("contactLists/12345/clear.json").with(:query => { :apiKey => "api_key" }).should have_been_made
87
+ end
88
+ end
89
+ end
@@ -0,0 +1,108 @@
1
+ require 'helper'
2
+ require 'fullcontact'
3
+
4
+ describe FullContact::Client::Contact do
5
+
6
+ before do
7
+ FullContact.configure do |config|
8
+ config.api_key = "api_key"
9
+ end
10
+ @client = FullContact::Client.new
11
+ end
12
+
13
+ # describe "#update_contact" do
14
+ # before do
15
+ # stub_post("contactLists/12345.json").
16
+ # with(:query => { :apiKey => "api_key", :request_body => "", :content_type => "application/json") }, :headers => {'Accept'=>'application/json', 'Content-Length'=>'0', 'Content-Type'=>'application/json', 'User-Agent'=>'FullContact Ruby Gem'}).
17
+ # to_return(:body => fixture("update_contact.json"), :headers => {:content_type => "application/json; charset=utf-8"})
18
+ # end
19
+ # it "should send a post to contactLists" do
20
+ # @client.update_contact("12345", {:contact_data => {}})
21
+ # a_post("contactLists/12345.json").with(:query => { :apiKey => "api_key" }).should have_been_made
22
+ # end
23
+ # end
24
+
25
+ describe "#get_contact" do
26
+ before do
27
+ stub_get("contactLists/12345/54321.json").
28
+ with(:query => { :apiKey => "api_key" }).
29
+ to_return(:body => fixture("get_contact.json"), :headers => {:content_type => "application/json; charset=utf-8"})
30
+ end
31
+ it "should get the contact" do
32
+ @client.get_contact("12345", "54321")
33
+ a_get("contactLists/12345/54321.json").with(:query => { :apiKey => "api_key" }).should have_been_made
34
+ end
35
+ end
36
+
37
+ describe "#delete_contact" do
38
+ before do
39
+ stub_delete("contactLists/12345/54321.json").
40
+ with(:query => { :apiKey => "api_key" }).
41
+ to_return(:body => fixture("delete_contact.json"), :headers => {:content_type => "application/json; charset=utf-8"})
42
+ end
43
+ it "should delete the contact" do
44
+ @client.delete_contact("12345", "54321")
45
+ a_delete("contactLists/12345/54321.json").with(:query => { :apiKey => "api_key" }).should have_been_made
46
+ end
47
+ end
48
+
49
+ describe "#has_enriched_updates?" do
50
+ before do
51
+ stub_get("contactLists/12345/54321/hasUpdates.json").
52
+ with(:query => { :apiKey => "api_key" }).
53
+ to_return(:body => fixture("has_enriched_updates.json"), :headers => {:content_type => "application/json; charset=utf-8"})
54
+ end
55
+ it "should make a get to find whether or not there are enriched updates" do
56
+ @client.has_enriched_updates?("12345", "54321")
57
+ a_get("contactLists/12345/54321/hasUpdates.json").with(:query => { :apiKey => "api_key" }).should have_been_made
58
+ end
59
+ end
60
+
61
+ describe "#get_updates" do
62
+ before do
63
+ stub_get("contactLists/12345/54321/updates.json").
64
+ with(:query => { :apiKey => "api_key" }).
65
+ to_return(:body => fixture("get_updates.json"), :headers => {:content_type => "application/json; charset=utf-8"})
66
+ end
67
+ it "should get the latest updates" do
68
+ @client.get_updates("12345", "54321")
69
+ a_get("contactLists/12345/54321/updates.json").with(:query => { :apiKey => "api_key" }).should have_been_made
70
+ end
71
+ end
72
+
73
+ describe "#get_enriched_contact" do
74
+ before do
75
+ stub_get("contactLists/12345/54321/enriched.json").
76
+ with(:query => { :apiKey => "api_key" }).
77
+ to_return(:body => fixture("get_enriched_contact.json"), :headers => {:content_type => "application/json; charset=utf-8"})
78
+ end
79
+ it "should get the enriched contact" do
80
+ @client.get_enriched_contact("12345", "54321")
81
+ a_get("contactLists/12345/54321/enriched.json").with(:query => { :apiKey => "api_key" }).should have_been_made
82
+ end
83
+ end
84
+
85
+ describe "#save_enriched_contact" do
86
+ before do
87
+ stub_post("contactLists/12345/54321/enriched.json").
88
+ with(:query => { :apiKey => "api_key" }).
89
+ to_return(:body => fixture("save_enriched_contact.json"), :headers => {:content_type => "application/json; charset=utf-8"})
90
+ end
91
+ it "should save the enriched contact" do
92
+ @client.save_enriched_contact("12345", "54321")
93
+ a_post("contactLists/12345/54321/enriched.json").with(:query => { :apiKey => "api_key" }).should have_been_made
94
+ end
95
+ end
96
+
97
+ describe "#contact_history" do
98
+ before do
99
+ stub_get("contactLists/12345/54321/history.json").
100
+ with(:query => { :apiKey => "api_key" }).
101
+ to_return(:body => fixture("contact_history.json"), :headers => {:content_type => "application/json; charset=utf-8"})
102
+ end
103
+ it "should get the contact history" do
104
+ @client.contact_history("12345", "54321")
105
+ a_get("contactLists/12345/54321/history.json").with(:query => { :apiKey => "api_key" }).should have_been_made
106
+ end
107
+ end
108
+ end
@@ -0,0 +1,24 @@
1
+ require 'helper'
2
+ require 'fullcontact'
3
+
4
+ describe FullContact::Client::Name do
5
+
6
+ before do
7
+ FullContact.configure do |config|
8
+ config.api_key = "api_key"
9
+ end
10
+ @client = FullContact::Client.new
11
+ end
12
+
13
+ describe "#get_social_icon_url" do
14
+ before do
15
+ stub_get("icon/facebook/32/default").
16
+ with(:query => { :apiKey => "api_key"}).
17
+ to_return(:status => [302, "Moved Temporarily"])
18
+ end
19
+ it "should get an icon url with 302 redirect" do
20
+ @client.get_social_icon_url('facebook','32','default')
21
+ a_get("icon/facebook/32/default").with(:query => { :apiKey => "api_key"}).should have_been_made
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,121 @@
1
+ require 'helper'
2
+ require 'fullcontact'
3
+
4
+ describe FullContact::Client::Name do
5
+
6
+ before do
7
+ FullContact.configure do |config|
8
+ config.api_key = "api_key"
9
+ end
10
+ @client = FullContact::Client.new
11
+ end
12
+
13
+ describe "#normalize" do
14
+ before do
15
+ stub_get("name/normalizer.json").
16
+ with(:query => { :apiKey => "api_key", :q => "John Smith" }).
17
+ to_return(:body => fixture("normalize.json"), :headers => {:content_type => "application/json; charset=utf-8"})
18
+ end
19
+ it "should get normalized name" do
20
+ @client.normalize('John Smith')
21
+ a_get("name/normalizer.json").with(:query => { :apiKey => "api_key", :q => "John Smith" }).should have_been_made
22
+ end
23
+ end
24
+
25
+ describe "#deduce_by_email" do
26
+ before do
27
+ stub_get("name/deducer.json").
28
+ with(:query => { :apiKey => "api_key", :email => "johnsmith@gmail.com" }).
29
+ to_return(:body => fixture("deduce_by_email.json"), :headers => {:content_type => "application/json; charset=utf-8"})
30
+ end
31
+ it "should get deduced name" do
32
+ @client.deduce_by_email('johnsmith@gmail.com')
33
+ a_get("name/deducer.json").with(:query => { :apiKey => "api_key", :email => "johnsmith@gmail.com" }).should have_been_made
34
+ end
35
+ end
36
+
37
+ describe "#deduce_by_username" do
38
+ before do
39
+ stub_get("name/deducer.json").
40
+ with(:query => { :apiKey => "api_key", :username => "johnsmith" }).
41
+ to_return(:body => fixture("deduce_by_username.json"), :headers => {:content_type => "application/json; charset=utf-8"})
42
+ end
43
+ it "should get deduced name" do
44
+ @client.deduce_by_username('johnsmith')
45
+ a_get("name/deducer.json").with(:query => { :apiKey => "api_key", :username => "johnsmith" }).should have_been_made
46
+ end
47
+ end
48
+
49
+ describe "#similarity" do
50
+ before do
51
+ stub_get("name/similarity.json").
52
+ with(:query => { :apiKey => "api_key", :q1 => "john", :q2 => "john smith" }).
53
+ to_return(:body => fixture("similarity.json"), :headers => {:content_type => "application/json; charset=utf-8"})
54
+ end
55
+ it "should get similarity" do
56
+ @client.similarity('john', 'john smith')
57
+ a_get("name/similarity.json").with(:query => { :apiKey => "api_key", :q1 => "john", :q2 => "john smith" }).should have_been_made
58
+ end
59
+ end
60
+
61
+ describe "#stats_by_name" do
62
+ before do
63
+ stub_get("name/stats.json").
64
+ with(:query => { :apiKey => "api_key", :name => "john" }).
65
+ to_return(:body => fixture("stats_by_name.json"), :headers => {:content_type => "application/json; charset=utf-8"})
66
+ end
67
+ it "should get stats" do
68
+ @client.stats_by_name('john')
69
+ a_get("name/stats.json").with(:query => { :apiKey => "api_key", :name => "john" }).should have_been_made
70
+ end
71
+ end
72
+
73
+ describe "#stats_by_given_name" do
74
+ before do
75
+ stub_get("name/stats.json").
76
+ with(:query => { :apiKey => "api_key", :givenName => "john" }).
77
+ to_return(:body => fixture("stats_by_given_name.json"), :headers => {:content_type => "application/json; charset=utf-8"})
78
+ end
79
+ it "should get stats" do
80
+ @client.stats_by_given_name('john')
81
+ a_get("name/stats.json").with(:query => { :apiKey => "api_key", :givenName => "john" }).should have_been_made
82
+ end
83
+ end
84
+
85
+ describe "#stats_by_family_name" do
86
+ before do
87
+ stub_get("name/stats.json").
88
+ with(:query => { :apiKey => "api_key", :familyName => "smith" }).
89
+ to_return(:body => fixture("stats_by_family_name.json"), :headers => {:content_type => "application/json; charset=utf-8"})
90
+ end
91
+ it "should get stats" do
92
+ @client.stats_by_family_name('smith')
93
+ a_get("name/stats.json").with(:query => { :apiKey => "api_key", :familyName => "smith" }).should have_been_made
94
+ end
95
+ end
96
+
97
+ describe "#stats_by_given_and_family_name" do
98
+ before do
99
+ stub_get("name/stats.json").
100
+ with(:query => { :apiKey => "api_key", :givenName => 'john', :familyName => "smith" }).
101
+ to_return(:body => fixture("stats_by_given_and_family_name.json"), :headers => {:content_type => "application/json; charset=utf-8"})
102
+ end
103
+ it "should get stats" do
104
+ @client.stats_by_given_and_family_name('john','smith')
105
+ a_get("name/stats.json").with(:query => { :apiKey => "api_key", :givenName => 'john', :familyName => "smith" }).should have_been_made
106
+ end
107
+ end
108
+
109
+ describe "#parse" do
110
+ before do
111
+ stub_get("name/parser.json").
112
+ with(:query => { :apiKey => "api_key", :q => 'Smith John' }).
113
+ to_return(:body => fixture("parse.json"), :headers => {:content_type => "application/json; charset=utf-8"})
114
+ end
115
+ it "should get parsed name" do
116
+ @client.parse('Smith John')
117
+ a_get("name/parser.json").with(:query => { :apiKey => "api_key", :q => 'Smith John' }).should have_been_made
118
+ end
119
+ end
120
+
121
+ end