Sha256: 28e6b312427ce8309b6849c046ec1915cbfa5495a663508ad60758c3a2505121
Contents?: true
Size: 859 Bytes
Versions: 12
Compression:
Stored size: 859 Bytes
Contents
# frozen_string_literal: true require 'rails_helper' describe DHS::Record do let(:datastore) do 'http://datastore/v2' end let(:response) do { body: [{ name: 'Steve' }] } end before do DHC.config.placeholder('datastore', datastore) class Record < DHS::Record endpoint '{+datastore}/records/' end end context 'where values hash' do it 'provides the hash or where parameters that have been requested' do stub_request(:get, 'http://datastore/v2/records/?available=true&color=blue').to_return(response) expect( Record.where(available: true).where(color: 'blue').where_values_hash ).to eq(available: true, color: 'blue') expect( Record.where(available: true, color: 'red').where(color: 'blue').where_values_hash ).to eq(available: true, color: 'blue') end end end
Version data entries
12 entries across 12 versions & 1 rubygems