Sha256: c7c337227d94d6569bd89cce54b9f1bacda72a113121dfaa024314f205e48a88

Contents?: true

Size: 931 Bytes

Versions: 12

Compression:

Stored size: 931 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

  let(:data_from_raw) do
    LHS::Data.new(
      href: 'http://www.local.ch/v2/stuff',
      id: '123123123'
    )
  end

  let(:data_from_item) do
    raw = { href: 'http://www.local.ch/v2/stuff' }
    item = LHS::Item.new(LHS::Data.new(raw))
    LHS::Data.new(item)
  end

  context 'raw' do
    it 'you can access raw data that is underlying' do
      expect(data_from_raw._raw).to be_kind_of Hash
    end

    it 'forwards raw when you feed data with some LHS object' do
      expect(data_from_item._raw).to be_kind_of Hash
      expect(data_from_item._raw).to eq(
        href: 'http://www.local.ch/v2/stuff'
      )
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
lhs-3.3.6 spec/data/raw_spec.rb
lhs-3.3.5 spec/data/raw_spec.rb
lhs-3.3.3 spec/data/raw_spec.rb
lhs-3.3.2 spec/data/raw_spec.rb
lhs-3.3.1 spec/data/raw_spec.rb
lhs-3.3.0 spec/data/raw_spec.rb
lhs-3.2.0 spec/data/raw_spec.rb
lhs-3.1.3 spec/data/raw_spec.rb
lhs-3.1.1 spec/data/raw_spec.rb
lhs-3.1.0 spec/data/raw_spec.rb
lhs-3.0.5 spec/data/raw_spec.rb
lhs-3.0.4 spec/data/raw_spec.rb