Sha256: eebf0ef0db543734001d4d15388f16472f6bfd2c3439c4ca1c8b116784ec1b25
Contents?: true
Size: 616 Bytes
Versions: 16
Compression:
Stored size: 616 Bytes
Contents
require 'rails_helper' describe LHS::Item do before(:each) do class Record < LHS::Record endpoint '{+datastore}/records' end end let(:json) do { local_entry_id: 'ABC123' } end let(:item) do LHS::Data.new(json, nil, Record) end it 'is possible to fetch data' do expect( item.fetch(:local_entry_id) ).to eq 'ABC123' end context 'empty data' do let(:json) do {} end it 'is possible to get a default when fetched data is nil' do expect( item.fetch(:local_entry_id, 'DEFAULT') ).to eq 'DEFAULT' end end end
Version data entries
16 entries across 16 versions & 1 rubygems