Sha256: d6cc8443b9e9f2681341a8cc55528f7b68bdfb3179e988985349415b7e71141f

Contents?: true

Size: 939 Bytes

Versions: 25

Compression:

Stored size: 939 Bytes

Contents

require 'rails_helper'

describe LHS::Data do

  before(:each) do
    class SomeService < LHS::Service
      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

25 entries across 25 versions & 1 rubygems

Version Path
lhs-2.2.2 spec/data/raw_spec.rb
lhs-1.6.1 spec/data/raw_spec.rb
lhs-2.2.1 spec/data/raw_spec.rb
lhs-2.2.0 spec/data/raw_spec.rb
lhs-1.6.0 spec/data/raw_spec.rb
lhs-2.1.1 spec/data/raw_spec.rb
lhs-2.1.0 spec/data/raw_spec.rb
lhs-2.0.5 spec/data/raw_spec.rb
lhs-2.0.4 spec/data/raw_spec.rb
lhs-2.0.3 spec/data/raw_spec.rb
lhs-2.0.2 spec/data/raw_spec.rb
lhs-2.0.1 spec/data/raw_spec.rb
lhs-2.0.0 spec/data/raw_spec.rb
lhs-1.5.0 spec/data/raw_spec.rb
lhs-1.4.0 spec/data/raw_spec.rb
lhs-1.3.1 spec/data/raw_spec.rb
lhs-1.3.0 spec/data/raw_spec.rb
lhs-1.2.3 spec/data/raw_spec.rb
lhs-1.2.2 spec/data/raw_spec.rb
lhs-1.2.1 spec/data/raw_spec.rb