Sha256: 327c5eb523002b60ea8ec828a125b38fdaa8aeeffc232ee9817acc75175c6e8e

Contents?: true

Size: 778 Bytes

Versions: 98

Compression:

Stored size: 778 Bytes

Contents

require 'rails_helper'

describe LHS::Data do
  before(:each) do
    class Record < LHS::Record
      endpoint 'http://local.ch/records'
    end
  end

  let(:item) do
    {
      customer: {
        addresses: [
          {
            first_line: 'Bachstr. 6'
          }
        ]
      }
    }
  end

  let(:data) do
    LHS::Data.new(
      {
        href: 'http://local.ch/records',
        items: [item]
      }, nil, Record
    )
  end

  it 'provides the information which type of proxy data ist' do
    expect(data.collection?).to eq true
    expect(data.first.item?).to eq true
    expect(data.first.customer.item?).to eq true
    expect(data.first.customer.addresses.collection?).to eq true
    expect(data.first.customer.addresses.first.item?).to eq true
  end
end

Version data entries

98 entries across 98 versions & 1 rubygems

Version Path
lhs-11.0.2 spec/data/is_item_or_collection_spec.rb
lhs-11.0.1 spec/data/is_item_or_collection_spec.rb
lhs-11.0.0 spec/data/is_item_or_collection_spec.rb
lhs-10.1.1 spec/data/is_item_or_collection_spec.rb
lhs-10.1.0 spec/data/is_item_or_collection_spec.rb
lhs-10.0.0 spec/data/is_item_or_collection_spec.rb
lhs-9.1.1 spec/data/is_item_or_collection_spec.rb
lhs-9.1.0 spec/data/is_item_or_collection_spec.rb
lhs-9.0.4 spec/data/is_item_or_collection_spec.rb
lhs-9.0.3 spec/data/is_item_or_collection_spec.rb
lhs-9.0.2 spec/data/is_item_or_collection_spec.rb
lhs-9.0.1 spec/data/is_item_or_collection_spec.rb
lhs-9.0.0 spec/data/is_item_or_collection_spec.rb
lhs-8.0.0 spec/data/is_item_or_collection_spec.rb
lhs-7.4.1 spec/data/is_item_or_collection_spec.rb
lhs-7.4.0 spec/data/is_item_or_collection_spec.rb
lhs-7.3.0 spec/data/is_item_or_collection_spec.rb
lhs-7.2.5 spec/data/is_item_or_collection_spec.rb
lhs-7.2.4 spec/data/is_item_or_collection_spec.rb
lhs-7.2.3 spec/data/is_item_or_collection_spec.rb