Sha256: 41257ef54c933f2f1b4554f827af578bb3bffd718ef9db4e14d47f63533bb1d1

Contents?: true

Size: 782 Bytes

Versions: 3

Compression:

Stored size: 782 Bytes

Contents

# encoding: UTF-8
require 'test_helper'

class GoogleTest < Test::Unit::TestCase
  def test_url_is_signed_for_business_accounts
    geocoder = Graticule.service(:google).new("e7-fake-account-R911GuLecpVqA=", 'gme-example')
    url = geocoder.send :make_url, :address => 'New York'
    expected = "https://maps.googleapis.com/maps/api/geocode/json?address=New%20York&client=gme-example&sensor=false&signature=EJNTEh9SqstO1FLcbFsQ0aJrWHA="
    assert_equal expected, url.to_s
  end

  def test_url_is_not_signed_for_normal_accounts
    geocoder = Graticule.service(:google).new()
    url = geocoder.send :make_url, :address => 'New York'
    expected = "https://maps.googleapis.com/maps/api/geocode/json?address=New%20York&sensor=false"
    assert_equal expected, url.to_s
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
graticule-2.7.2 test/graticule/geocoder/google_signed_test.rb
graticule-2.7.1 test/graticule/geocoder/google_signed_test.rb
graticule-2.7.0 test/graticule/geocoder/google_signed_test.rb