Sha256: c8ac00a229a58375cab5bf87c5b6c2370652306e968c006e11324ce164144772

Contents?: true

Size: 793 Bytes

Versions: 18

Compression:

Stored size: 793 Bytes

Contents

require 'spec_helper'

describe Contentful::Location do
  let(:location)do
    vcr('location')do
      Contentful::Client.new(
        space: 'lzjz8hygvfgu',
        access_token: '0c6ef483524b5e46b3bafda1bf355f38f5f40b4830f7599f790a410860c7c271',
        dynamic_entries: :auto,
      ).entry('3f6fq5ylFCi4kIYAQKsAYG').location
    end
  end

  describe 'Properties' do
    it 'has a #properties getter returning a hash with symbol keys' do
      expect(location.properties).to be_a Hash
      expect(location.properties.keys.sample).to be_a Symbol
    end

    it 'has #lat' do
      expect(location.lat).to be_a Float
      expect(location.lat.to_i).to eq 36
    end

    it 'has #lon' do
      expect(location.lon).to be_a Float
      expect(location.lon.to_i).to eq -94
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
contentful-1.2.2 spec/location_spec.rb
contentful-1.2.1 spec/location_spec.rb
contentful-1.2.0 spec/location_spec.rb
contentful-1.1.1 spec/location_spec.rb
contentful-1.1.0 spec/location_spec.rb
contentful-1.0.2 spec/location_spec.rb
contentful-1.0.1 spec/location_spec.rb
contentful-1.0.0 spec/location_spec.rb
contentful-0.12.0 spec/location_spec.rb
contentful-0.11.0 spec/location_spec.rb
contentful-0.10.0 spec/location_spec.rb
contentful-0.9.0 spec/location_spec.rb
contentful-0.8.0 spec/location_spec.rb
contentful-0.7.0 spec/location_spec.rb
contentful-0.6.0 spec/location_spec.rb
contentful-0.5.0 spec/location_spec.rb
contentful-0.4.0 spec/location_spec.rb
contentful-0.3.5 spec/location_spec.rb