Sha256: bf7d8269d7ba1c4abf52389f9939884587942b1e192e60d2501e090ecccc6c03
Contents?: true
Size: 807 Bytes
Versions: 16
Compression:
Stored size: 807 Bytes
Contents
require 'rails_helper' describe LHS::Record do context 'definitions' do let(:datastore) { 'http://local.ch/v2' } before(:each) do LHC.config.placeholder('datastore', datastore) class LocalEntry < LHS::Record endpoint '{+datastore}/local-entries' endpoint '{+datastore}/local-entries/{id}' end end it 'allows mappings in all functions/defitions' do class LocalEntry < LHS::Record def name addresses.first.business.identities.first.name end end stub_request(:get, "#{datastore}/local-entries/1") .to_return(status: 200, body: { addresses: [{ business: { identities: [{ name: 'Löwenzorn' }] } }] }.to_json) entry = LocalEntry.find(1) expect(entry.name).to eq 'Löwenzorn' end end end
Version data entries
16 entries across 16 versions & 1 rubygems