Sha256: bf8b8b59158249b8ddb57ab6e046822a78d3bef83c08a5797144274b6f4d4e2a
Contents?: true
Size: 802 Bytes
Versions: 130
Compression:
Stored size: 802 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
130 entries across 130 versions & 1 rubygems