Sha256: 5ddeb0084440b9372b233d53c9d38a706b29a9103a0c010fc83feb16be5083bd

Contents?: true

Size: 873 Bytes

Versions: 24

Compression:

Stored size: 873 Bytes

Contents

require 'spec_helper'

describe Contentful::Locale do
  let(:locale) { vcr('locale') { create_client.space.locales.first } }

  describe 'Properties' do
    it 'has #code' do
      expect(locale.code).to eq 'en-US'
    end

    it 'has #name' do
      expect(locale.name).to eq 'English'
    end

    it 'has #default' do
      expect(locale.default).to eq true
    end
  end

  describe 'locales endpoint' do
    it 'locales can be fetched from environments' do
      vcr('locale_from_environment') {
        client = create_client(
          space: 'facgnwwgj5fe',
          access_token: '<ACCESS_TOKEN>',
          environment: 'testing'
        )

        locales = client.locales

        expect(locales).to be_a ::Contentful::Array
        expect(locales.first).to be_a ::Contentful::Locale
        expect(locales.first.code).to eq 'en-US'
      }
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
contentful-2.16.0 spec/locale_spec.rb
contentful-2.15.4 spec/locale_spec.rb
contentful-2.15.3 spec/locale_spec.rb
contentful-2.15.2 spec/locale_spec.rb
contentful-2.15.1 spec/locale_spec.rb
contentful-2.15.0 spec/locale_spec.rb
contentful-2.14.0 spec/locale_spec.rb
contentful-2.13.3 spec/locale_spec.rb
contentful-2.13.2 spec/locale_spec.rb
contentful-2.13.1 spec/locale_spec.rb
contentful-2.13.0 spec/locale_spec.rb
contentful-2.12.0 spec/locale_spec.rb
contentful-2.11.1 spec/locale_spec.rb
contentful-2.11.0 spec/locale_spec.rb
contentful-2.10.1 spec/locale_spec.rb
contentful-2.10.0 spec/locale_spec.rb
contentful-2.9.4 spec/locale_spec.rb
contentful-2.9.3 spec/locale_spec.rb
contentful-2.9.2 spec/locale_spec.rb
contentful-2.9.1 spec/locale_spec.rb