Sha256: df04523e7089e5ce7bfca9a7e99ffd20f0b23cd626817768c59c632cc36e0275

Contents?: true

Size: 704 Bytes

Versions: 2

Compression:

Stored size: 704 Bytes

Contents

require 'spec_helper'


describe 'Resource Building Examples' do
  it 'can deal with arrays' do
    response = Contentful::Response.new raw_fixture('link_array')
    resource = Contentful::ResourceBuilder.new(create_client, response).run

    expect( resource.fields[:links] ).to be_a Array
    expect( resource.fields[:links].first ).to be_a Contentful::Link
  end

  it 'replaces links with included versions if present' do
    response = Contentful::Response.new raw_fixture('includes')
    resource = Contentful::ResourceBuilder.new(create_client, response).run.first

    expect( resource.fields[:links] ).to be_a Array
    expect( resource.fields[:links].first ).to be_a Contentful::Entry
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
contentful-0.1.2 spec/resource_building_spec.rb
contentful-0.1.1 spec/resource_building_spec.rb