Skip to content
Snippets Groups Projects
Commit 6b88b3a3 authored by Alex Reisner's avatar Alex Reisner
Browse files

Move test from base to smarty_streets.

parent e14f34b1
No related branches found
No related tags found
No related merge requests found
......@@ -56,22 +56,6 @@ class LookupTest < GeocoderTestCase
end
end
def test_raises_exception_on_error_http_status
error_statuses = {
'400' => Geocoder::InvalidRequest,
'401' => Geocoder::RequestDenied,
'402' => Geocoder::OverQueryLimitError
}
Geocoder.configure(always_raise: error_statuses.values)
error_statuses.each do |code, err|
assert_raises err do
lookup = Geocoder::Lookup.get(:smarty_streets)
response = MockHttpResponse.new(code: code.to_i)
lookup.send(:check_response_for_errors!, response)
end
end
end
def test_raises_exception_on_invalid_key
Geocoder.configure(:always_raise => [Geocoder::InvalidApiKey])
#Geocoder::Lookup.all_services_except_test.each do |l|
......
......@@ -51,4 +51,19 @@ class SmartyStreetsTest < GeocoderTestCase
assert_equal 0, results.length
end
def test_raises_exception_on_error_http_status
error_statuses = {
'400' => Geocoder::InvalidRequest,
'401' => Geocoder::RequestDenied,
'402' => Geocoder::OverQueryLimitError
}
Geocoder.configure(always_raise: error_statuses.values)
lookup = Geocoder::Lookup.get(:smarty_streets)
error_statuses.each do |code, err|
assert_raises err do
response = MockHttpResponse.new(code: code.to_i)
lookup.send(:check_response_for_errors!, response)
end
end
end
end
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment