Sha256: 0ea9fc4965dbcb8e8492094b00befb851206817cbdca2a2c320421286cdb108d
Contents?: true
Size: 1.01 KB
Versions: 18
Compression:
Stored size: 1.01 KB
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 it 'can also reference itself' do response = Contentful::Response.new raw_fixture('self_link') resource = Contentful::ResourceBuilder.new(create_client, response).run.first other_resource = resource.fields[:e] expect(other_resource).to be_a Contentful::Entry expect(other_resource.fields[:e]).to be resource end end
Version data entries
18 entries across 18 versions & 1 rubygems