Sha256: dcf2e516b4850285bd349fa8b035aeb698e3e84500b285c34413556303b98670

Contents?: true

Size: 632 Bytes

Versions: 21

Compression:

Stored size: 632 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: {
        address: {
          first_line: 'Bachstr. 6'
        }
      }
    }
  end

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

  it 'possible to navigate the parent' do
    expect(
      data.first.customer.address.parent
    ).to eq data.first.customer
    expect(
      data.first.customer.address.parent.parent
    ).to eq data.first
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
lhs-6.4.0 spec/data/parent_spec.rb
lhs-6.3.1 spec/data/parent_spec.rb
lhs-6.3.0 spec/data/parent_spec.rb
lhs-6.2.0 spec/data/parent_spec.rb
lhs-6.1.0 spec/data/parent_spec.rb
lhs-6.0.0 spec/data/parent_spec.rb
lhs-5.7.1 spec/data/parent_spec.rb
lhs-5.7.0 spec/data/parent_spec.rb
lhs-5.6.6 spec/data/parent_spec.rb
lhs-5.6.5 spec/data/parent_spec.rb
lhs-5.6.4 spec/data/parent_spec.rb
lhs-5.6.3 spec/data/parent_spec.rb
lhs-5.6.2 spec/data/parent_spec.rb
lhs-5.6.1 spec/data/parent_spec.rb
lhs-5.6.0 spec/data/parent_spec.rb
lhs-5.5.0 spec/data/parent_spec.rb
lhs-5.4.2 spec/data/parent_spec.rb
lhs-5.4.1 spec/data/parent_spec.rb
lhs-5.4.0 spec/data/parent_spec.rb
lhs-5.3.0 spec/data/parent_spec.rb