Sha256: 38d32de04ba618ab01052e95f6acf4abb0e743a5f86ed7e728dfe491c12aa3da

Contents?: true

Size: 828 Bytes

Versions: 19

Compression:

Stored size: 828 Bytes

Contents

require 'rails_helper'

describe LHS::Record do
  let(:datastore) do
    'http://datastore/v2'
  end

  let(:response) do
    { body: [{ name: 'Steve' }] }
  end

  before do
    LHC.config.placeholder('datastore', datastore)
    class Record < LHS::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

19 entries across 19 versions & 1 rubygems

Version Path
lhs-16.1.5 spec/record/where_values_hash_spec.rb
lhs-16.1.4 spec/record/where_values_hash_spec.rb
lhs-16.1.3 spec/record/where_values_hash_spec.rb
lhs-16.1.2 spec/record/where_values_hash_spec.rb
lhs-16.1.1 spec/record/where_values_hash_spec.rb
lhs-16.1.0 spec/record/where_values_hash_spec.rb
lhs-16.0.1 spec/record/where_values_hash_spec.rb
lhs-16.0.0 spec/record/where_values_hash_spec.rb
lhs-15.7.0 spec/record/where_values_hash_spec.rb
lhs-15.6.1 spec/record/where_values_hash_spec.rb
lhs-15.6.0 spec/record/where_values_hash_spec.rb
lhs-15.5.1 spec/record/where_values_hash_spec.rb
lhs-15.5.0 spec/record/where_values_hash_spec.rb
lhs-15.4.1 spec/record/where_values_hash_spec.rb
lhs-15.4.0 spec/record/where_values_hash_spec.rb
lhs-15.4.0.pre.hasone.1 spec/record/where_values_hash_spec.rb
lhs-15.3.3 spec/record/where_values_hash_spec.rb
lhs-15.3.3.pre.fixoptions.1 spec/record/where_values_hash_spec.rb
lhs-15.3.2 spec/record/where_values_hash_spec.rb