Sha256: 89acf1c576ac6f41e9cdf39e9ff818447a38df79d1c730336cb88dd68e79bee1

Contents?: true

Size: 1.13 KB

Versions: 18

Compression:

Stored size: 1.13 KB

Contents

require 'spec_helper'

describe Contentful::ContentType do
  let(:content_type) { vcr('content_type') { create_client.content_type 'cat' } }

  describe 'SystemProperties' do
    it 'has a #sys getter returning a hash with symbol keys' do
      expect(content_type.sys).to be_a Hash
      expect(content_type.sys.keys.sample).to be_a Symbol
    end

    it 'has #id' do
      expect(content_type.id).to eq 'cat'
    end

    it 'has #type' do
      expect(content_type.type).to eq 'ContentType'
    end
  end

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

    it 'has #name' do
      expect(content_type.name).to eq 'Cat'
    end

    it 'has #description' do
      expect(content_type.description).to eq 'Meow.'
    end

    it 'has #fields' do
      expect(content_type.fields).to be_a Array
      expect(content_type.fields.first).to be_a Contentful::Field
    end

    it 'could have #display_field' do
      expect(content_type).to respond_to :display_field
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

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