Permalink
Browse files

Merge pull request #231 from davekrupinski/master

Enable ShowPostal for GeocoderCA Lookup
  • Loading branch information...
2 parents 0ead6f9 + 4899fb7 commit 56a3bf1758d026f66b670cb1e384c2b24539e41f @alexreisner committed May 14, 2012
Showing with 8 additions and 0 deletions.
  1. +1 −0 lib/geocoder/lookups/geocoder_ca.rb
  2. +7 −0 test/lookup_test.rb
@@ -33,6 +33,7 @@ def query_url(query, reverse = false)
params[:reverse] = 1
else
params[:locate] = query
+ params[:showpostal] = 1
end
"http://geocoder.ca/?" + hash_to_query(params)
end
View
@@ -27,4 +27,11 @@ def test_yahoo_app_id
g = Geocoder::Lookup::Yahoo.new
assert_match "appid=MY_KEY", g.send(:query_url, "Madison Square Garden, New York, NY 10001, United States")
end
+
+ def test_geocoder_ca_showpostal
+ Geocoder::Configuration.api_key = "MY_KEY"
+ g = Geocoder::Lookup::GeocoderCa.new
+ assert_match "showpostal=1", g.send(:query_url, "Madison Square Garden, New York, NY 10001, United States")
+ end
+
end

0 comments on commit 56a3bf1

Please sign in to comment.