Sha256: 16e7fdbc49a9e5ea518bcfb2437a029beea80c0f3bcfe2e2dce923b530e98d1f
Contents?: true
Size: 640 Bytes
Versions: 76
Compression:
Stored size: 640 Bytes
Contents
# frozen_string_literal: true require 'rails_helper' describe LHS::Item do before 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
76 entries across 76 versions & 1 rubygems