Sha256: 1f8d0a2e166ae7a62ad05b04782e96c1ea31c36f9fb57aee0d09b2f221220da9

Contents?: true

Size: 638 Bytes

Versions: 19

Compression:

Stored size: 638 Bytes

Contents

require 'rails_helper'

describe LHS::Item do
  before do
    class Record < LHS::Record
      endpoint '{+datastore}/v2/{campaign_id}/feedbacks'
      endpoint '{+datastore}/v2/feedbacks'
    end
  end

  let(:data) do
    LHS::Data.new({ addresses: [{ business: { identities: [{ name: 'Löwenzorn' }] } }] }, nil, Record)
  end

  context 'item getter' do
    it 'returns a collection if you access an array' do
      expect(data.addresses).to be_kind_of(LHS::Data)
      expect(data.addresses._proxy).to be_kind_of(LHS::Collection)
      expect(data.addresses.first.business.identities.first.name).to eq 'Löwenzorn'
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
lhs-16.1.5 spec/item/getter_spec.rb
lhs-16.1.4 spec/item/getter_spec.rb
lhs-16.1.3 spec/item/getter_spec.rb
lhs-16.1.2 spec/item/getter_spec.rb
lhs-16.1.1 spec/item/getter_spec.rb
lhs-16.1.0 spec/item/getter_spec.rb
lhs-16.0.1 spec/item/getter_spec.rb
lhs-16.0.0 spec/item/getter_spec.rb
lhs-15.7.0 spec/item/getter_spec.rb
lhs-15.6.1 spec/item/getter_spec.rb
lhs-15.6.0 spec/item/getter_spec.rb
lhs-15.5.1 spec/item/getter_spec.rb
lhs-15.5.0 spec/item/getter_spec.rb
lhs-15.4.1 spec/item/getter_spec.rb
lhs-15.4.0 spec/item/getter_spec.rb
lhs-15.4.0.pre.hasone.1 spec/item/getter_spec.rb
lhs-15.3.3 spec/item/getter_spec.rb
lhs-15.3.3.pre.fixoptions.1 spec/item/getter_spec.rb
lhs-15.3.2 spec/item/getter_spec.rb