addressfinder 1.9.1 → 1.10.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +7 -0
- data/README.md +23 -1
- data/addressfinder.gemspec +3 -2
- data/lib/addressfinder/bulk.rb +8 -0
- data/lib/addressfinder/v1/base.rb +71 -0
- data/lib/addressfinder/v1/email/verification.rb +16 -0
- data/lib/addressfinder/v1/phone/verification.rb +16 -0
- data/lib/addressfinder/version.rb +1 -1
- data/lib/addressfinder.rb +10 -0
- metadata +8 -34
- data/.gitignore +0 -11
- data/.travis.yml +0 -6
- data/Dockerfile +0 -28
- data/Gemfile +0 -3
- data/Guardfile +0 -5
- data/Rakefile +0 -7
- data/docker-compose.yml +0 -11
- data/spec/lib/addressfinder/address_autocomplete_spec.rb +0 -95
- data/spec/lib/addressfinder/address_info_spec.rb +0 -62
- data/spec/lib/addressfinder/address_search_spec.rb +0 -76
- data/spec/lib/addressfinder/bulk_spec.rb +0 -115
- data/spec/lib/addressfinder/location_info_spec.rb +0 -79
- data/spec/lib/addressfinder/location_search_spec.rb +0 -93
- data/spec/lib/addressfinder/util_spec.rb +0 -37
- data/spec/lib/addressfinder/v2/au/verification_spec.rb +0 -187
- data/spec/lib/addressfinder/verification_spec.rb +0 -170
- data/spec/lib/addressfinder_spec.rb +0 -74
- data/spec/spec_helper.rb +0 -20
@@ -1,74 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
require 'fileutils'
|
3
|
-
|
4
|
-
RSpec.describe AddressFinder do
|
5
|
-
before do
|
6
|
-
AddressFinder.configure do |af|
|
7
|
-
af.api_key = 'XXX'
|
8
|
-
af.api_secret = 'YYY'
|
9
|
-
af.default_country = 'nz'
|
10
|
-
af.timeout = 5
|
11
|
-
af.retries = 5
|
12
|
-
end
|
13
|
-
end
|
14
|
-
|
15
|
-
describe '#verification with verification_version configured to "v2"' do
|
16
|
-
before do
|
17
|
-
AddressFinder.configuration.verification_version = "v2"
|
18
|
-
end
|
19
|
-
|
20
|
-
after do
|
21
|
-
AddressFinder.configuration.verification_version = nil # set back to nil after
|
22
|
-
end
|
23
|
-
|
24
|
-
subject(:verification){ AddressFinder.verification(args) }
|
25
|
-
|
26
|
-
context "with country set to nz" do
|
27
|
-
let(:args){ {country: "nz", q: "12 high street sydney"} }
|
28
|
-
it "calls the old class" do
|
29
|
-
expect(AddressFinder::Verification).to receive_message_chain(:new, :perform, :result)
|
30
|
-
subject
|
31
|
-
end
|
32
|
-
|
33
|
-
it "safely passes arguments through" do
|
34
|
-
stub_request(:get, Addressable::Template.new("https://api.addressfinder.io/api/nz/address/verification{?args*}")).to_return(:status => 200, :body => "{}", :headers => {})
|
35
|
-
subject
|
36
|
-
end
|
37
|
-
end
|
38
|
-
|
39
|
-
context "with country set to au" do
|
40
|
-
let(:args){ {country: "au", q: "12 high street sydney"} }
|
41
|
-
it "calls the v2::Au class" do
|
42
|
-
expect(AddressFinder::V2::Au::Verification).to receive_message_chain(:new, :perform, :result)
|
43
|
-
subject
|
44
|
-
end
|
45
|
-
|
46
|
-
it "safely passes arguments through" do
|
47
|
-
stub_request(:get, Addressable::Template.new("https://api.addressfinder.io/api/au/address/v2/verification{?args*}")).to_return(:status => 200, :body => "{}", :headers => {})
|
48
|
-
subject
|
49
|
-
end
|
50
|
-
end
|
51
|
-
end
|
52
|
-
|
53
|
-
describe '#verification with verification_version not configured' do
|
54
|
-
subject(:verification){ AddressFinder.verification(args) }
|
55
|
-
|
56
|
-
context "with country set to nz" do
|
57
|
-
let(:args){ {country: "nz", q: "12 high street sydney"} }
|
58
|
-
|
59
|
-
it "calls the old class" do
|
60
|
-
expect(AddressFinder::Verification).to receive_message_chain(:new, :perform, :result)
|
61
|
-
subject
|
62
|
-
end
|
63
|
-
end
|
64
|
-
|
65
|
-
context "with country set to au" do
|
66
|
-
let(:args){ {country: "au", q: "12 high street sydney"} }
|
67
|
-
|
68
|
-
it "calls the old class" do
|
69
|
-
expect(AddressFinder::Verification).to receive_message_chain(:new, :perform, :result)
|
70
|
-
subject
|
71
|
-
end
|
72
|
-
end
|
73
|
-
end
|
74
|
-
end
|
data/spec/spec_helper.rb
DELETED
@@ -1,20 +0,0 @@
|
|
1
|
-
# This file was generated by the `rspec --init` command. Conventionally, all
|
2
|
-
# specs live under a `spec` directory, which RSpec adds to the `$LOAD_PATH`.
|
3
|
-
# Require this file using `require "spec_helper.rb"` to ensure that it is only
|
4
|
-
# loaded once.
|
5
|
-
#
|
6
|
-
# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration
|
7
|
-
|
8
|
-
require 'rubygems'
|
9
|
-
require 'bundler'
|
10
|
-
require 'webmock/rspec'
|
11
|
-
require 'addressfinder'
|
12
|
-
|
13
|
-
RSpec.configure do |config|
|
14
|
-
config.mock_with :rspec
|
15
|
-
|
16
|
-
config.filter_run :focus => true
|
17
|
-
config.run_all_when_everything_filtered = true
|
18
|
-
end
|
19
|
-
|
20
|
-
WebMock.disable_net_connect!
|