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

Include FreeGeoIP in no-results test.

parent 98691705
No related branches found
No related tags found
No related merge requests found
<html><title>404: Not Found</title><body>404: Not Found</body></html>
...@@ -4,7 +4,7 @@ require 'test_helper' ...@@ -4,7 +4,7 @@ require 'test_helper'
class LookupTest < Test::Unit::TestCase class LookupTest < Test::Unit::TestCase
def test_search_returns_empty_array_when_no_results def test_search_returns_empty_array_when_no_results
street_lookups.each do |l| all_lookups.each do |l|
lookup = Geocoder.send(:get_lookup, l) lookup = Geocoder.send(:get_lookup, l)
assert_equal [], lookup.send(:results, "no results"), assert_equal [], lookup.send(:results, "no results"),
"Lookup #{l} does not return empty array when no results." "Lookup #{l} does not return empty array when no results."
......
...@@ -122,7 +122,11 @@ module Geocoder ...@@ -122,7 +122,11 @@ module Geocoder
def fetch_raw_data(query, reverse = false) def fetch_raw_data(query, reverse = false)
raise TimeoutError if query == "timeout" raise TimeoutError if query == "timeout"
raise SocketError if query == "socket_error" raise SocketError if query == "socket_error"
read_fixture "freegeoip_74_200_247_59.json" file = case query
when "no results"; :no_results
else "74_200_247_59"
end
read_fixture "freegeoip_#{file}.json"
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