Skip to content

Commit

Permalink
Fix failing test for french direction
Browse files Browse the repository at this point in the history
see 3c749c2 for detail

Signed-off-by: Laurent Arnoud <[email protected]>
  • Loading branch information
spk committed Aug 1, 2011
1 parent 3c749c2 commit 98f72c9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/google_directions.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# encoding: UTF-8
require 'cgi'
require 'net/http'
require 'nokogiri'
require 'google_directions'
Expand Down Expand Up @@ -66,7 +67,7 @@ def convert_to_minutes(text)
end

def transcribe(location)
location.gsub(" ", "+")
CGI::escape(location)
end

def get_url(url)
Expand Down
2 changes: 1 addition & 1 deletion test/unit/google_directions_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def test_happy_case
directions = GoogleDirections.new("121 Gordonsville Highway, 37030", "499 Gordonsville Highway, 38563")
assert_equal(4, directions.distance_in_miles)
assert_equal(6, directions.drive_time_in_minutes)
assert_equal("http://maps.google.com/maps/api/directions/xml?sensor=false&origin=121+Gordonsville+Highway,+37030&destination=499+Gordonsville+Highway,+38563", directions.xml_call)
assert_equal('http://maps.google.com/maps/api/directions/xml?sensor=false&origin=121+Gordonsville+Highway%2C+37030&destination=499+Gordonsville+Highway%2C+38563', directions.xml_call)
# end_location > lat
assert_not_nil(directions.xml =~ /36\.1772300/)
end
Expand Down

0 comments on commit 98f72c9

Please sign in to comment.