Sha256: f40d9b702dcdbd94da53e6eb0a0731b5443db84973f9d821a036d1055373660e

Contents?: true

Size: 799 Bytes

Versions: 10

Compression:

Stored size: 799 Bytes

Contents

require 'spec_helper'

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

  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

10 entries across 10 versions & 1 rubygems

Version Path
contentful-0.3.4 spec/location_spec.rb
contentful-0.3.3 spec/location_spec.rb
contentful-0.3.2 spec/location_spec.rb
contentful-0.3.1 spec/location_spec.rb
contentful-0.3.0 spec/location_spec.rb
contentful-0.2.0 spec/location_spec.rb
contentful-0.1.3 spec/location_spec.rb
contentful-0.1.2 spec/location_spec.rb
contentful-0.1.1 spec/location_spec.rb
contentful-0.1.0 spec/location_spec.rb