Sha256: 22848c0f9b5931ae90113522d813f63dea7b2abeae911d55ee84ae366dc77a94

Contents?: true

Size: 607 Bytes

Versions: 44

Compression:

Stored size: 607 Bytes

Contents

require 'rails_helper'

describe LHS::Record do
  before(:each) do
    class Record < LHS::Record
      endpoint 'http://datastore/records/'
    end
  end

  context 'fetch' do
    let!(:request_stub) do
      stub_request(:get, "http://datastore/records/?available=true&color=blue&range=%3E26")
        .to_return(body: [{
          name: 'Steve'
        }].to_json)
    end

    it 'resolves chains' do
      records = Record.where(color: 'blue').where(range: '>26', available: true).fetch
      expect(request_stub).to have_been_requested
      expect(records.first.name).to eq 'Steve'
    end
  end
end

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
lhs-14.6.1 spec/record/fetch_spec.rb
lhs-14.6.0 spec/record/fetch_spec.rb
lhs-14.5.0 spec/record/fetch_spec.rb
lhs-14.4.0 spec/record/fetch_spec.rb
lhs-14.3.4 spec/record/fetch_spec.rb
lhs-14.3.3 spec/record/fetch_spec.rb
lhs-14.3.2 spec/record/fetch_spec.rb
lhs-14.3.1 spec/record/fetch_spec.rb
lhs-14.3.0 spec/record/fetch_spec.rb
lhs-14.2.0 spec/record/fetch_spec.rb
lhs-14.1.1 spec/record/fetch_spec.rb
lhs-14.1.0 spec/record/fetch_spec.rb
lhs-14.0.3 spec/record/fetch_spec.rb
lhs-14.0.2 spec/record/fetch_spec.rb
lhs-14.0.1 spec/record/fetch_spec.rb
lhs-14.0.0 spec/record/fetch_spec.rb
lhs-13.2.3 spec/record/fetch_spec.rb
lhs-13.2.2 spec/record/fetch_spec.rb
lhs-13.2.1 spec/record/fetch_spec.rb
lhs-13.2.0 spec/record/fetch_spec.rb