Sha256: 7d7e82b7c3bf237abf16b1f70cfb9df5f5adb865d4b04a60a3fe24db87ca3b83

Contents?: true

Size: 864 Bytes

Versions: 6

Compression:

Stored size: 864 Bytes

Contents

require 'spec_helper'

describe "Places" do
  
  let(:places) { File.read "spec/fixtures/google_places_valid.json" }
  
  context "valid request" do
    before(:each) do
      stub_request(:get, "https://maps.googleapis.com/maps/api/place/search/json?key=key&language=en&location=0,0&radius=7500&sensor=false").
               to_return(:status => 200, :body => places, :headers => {})
    end
    
    it "does something" do
      results = Gmaps4rails.places(0, 0, "key")
      result  = OpenStruct.new results.first
      
      result.lat.should eq -33.871983
      result.lng.should eq 151.199086
      result.name.should eq "Zaaffran Restaurant - BBQ and GRILL, Darling Harbour"
      result.reference.should =~ /^CpQBjAAAAHDHuimUQATR6gfoWNm.*/
      result.vicinity.should eq "Harbourside Centre 10 Darling Drive, Darling Harbour, Sydney"
    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
gmaps4rails-1.5.7 spec/lib/places_spec.rb
gmaps4rails-2.0.0.pre spec/lib/places_spec.rb
gmaps4rails-1.5.6 spec/lib/places_spec.rb
gmaps4rails-1.5.5 spec/lib/places_spec.rb
gmaps4rails-1.5.4 spec/lib/places_spec.rb
gmaps4rails-1.5.3 spec/lib/places_spec.rb