Sha256: 28a5b59e97b68d2b490e1abfccedbd5505a879277ad5b0ffddda8dc47626c7f3

Contents?: true

Size: 724 Bytes

Versions: 16

Compression:

Stored size: 724 Bytes

Contents

require 'rails_helper'

describe LHS::Data do
  before(:each) do
    class Record < LHS::Record
      endpoint '{+datastore}/v2/entries/{entry_id}/content-ads/{campaign_id}/feedbacks'
      endpoint '{+datastore}/v2/{campaign_id}/feedbacks'
      endpoint '{+datastore}/v2/feedbacks'
    end
  end

  context 'root' do
    it 'is navigateable from nested data' do
      root = LHS::Data.new({ 'items' => [{ 'campaign' => { 'id' => 123 } }] }, nil, Record)
      child = root.first
      leafe = child.campaign
      expect(leafe._root).to eq root
      expect(leafe._parent).to be_kind_of LHS::Data
      expect(leafe._parent._parent).to be_kind_of LHS::Data
      expect(leafe._parent._parent).to eq root
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
lhs-15.3.1 spec/data/root_spec.rb
lhs-15.3.1.pre.fixlhc.1 spec/data/root_spec.rb
lhs-15.3.0 spec/data/root_spec.rb
lhs-15.2.5 spec/data/root_spec.rb
lhs-15.2.4 spec/data/root_spec.rb
lhs-15.2.3 spec/data/root_spec.rb
lhs-15.2.3.pre.favorites.1 spec/data/root_spec.rb
lhs-15.2.2.pre.favorites.1 spec/data/root_spec.rb
lhs-15.2.2 spec/data/root_spec.rb
lhs-15.2.1 spec/data/root_spec.rb
lhs-15.2.0 spec/data/root_spec.rb
lhs-15.1.1 spec/data/root_spec.rb
lhs-15.1.0 spec/data/root_spec.rb
lhs-15.0.2 spec/data/root_spec.rb
lhs-15.0.1 spec/data/root_spec.rb
lhs-15.0.0 spec/data/root_spec.rb