Sha256: ca16f2a73614bc94bb4f1f7cfe6b67062d39c4da3acf5de92cfae71dfe6fd803

Contents?: true

Size: 492 Bytes

Versions: 12

Compression:

Stored size: 492 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

describe DHS::Item do
  context 'accessors' do
    before do
      class Record < DHS::Record
        endpoint 'http://datastore/records'
      end
    end

    it 'accesses camel case keys using underscore syntax' do
      stub_request(:get, 'http://datastore/records?id=1')
        .to_return(body: { 'AttributeValue' => 42 }.to_json)

      record = Record.find(1)
      expect(record.attribute_value).not_to be nil
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
dhs-1.6.0 spec/item/accessors_spec.rb
dhs-1.5.0 spec/item/accessors_spec.rb
dhs-1.4.2 spec/item/accessors_spec.rb
dhs-1.4.1 spec/item/accessors_spec.rb
dhs-1.4.0 spec/item/accessors_spec.rb
dhs-1.3.0 spec/item/accessors_spec.rb
dhs-1.2.0 spec/item/accessors_spec.rb
dhs-1.1.0 spec/item/accessors_spec.rb
dhs-1.0.3 spec/item/accessors_spec.rb
dhs-1.0.2 spec/item/accessors_spec.rb
dhs-1.0.1 spec/item/accessors_spec.rb
dhs-1.0.0 spec/item/accessors_spec.rb