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-15.3.1 spec/record/fetch_spec.rb
lhs-15.3.1.pre.fixlhc.1 spec/record/fetch_spec.rb
lhs-15.3.0 spec/record/fetch_spec.rb
lhs-15.2.5 spec/record/fetch_spec.rb
lhs-15.2.4 spec/record/fetch_spec.rb
lhs-15.2.3 spec/record/fetch_spec.rb
lhs-15.2.3.pre.favorites.1 spec/record/fetch_spec.rb
lhs-15.2.2.pre.favorites.1 spec/record/fetch_spec.rb
lhs-15.2.2 spec/record/fetch_spec.rb
lhs-15.2.1 spec/record/fetch_spec.rb
lhs-15.2.0 spec/record/fetch_spec.rb
lhs-15.1.1 spec/record/fetch_spec.rb
lhs-15.1.0 spec/record/fetch_spec.rb
lhs-15.0.2 spec/record/fetch_spec.rb
lhs-15.0.1 spec/record/fetch_spec.rb
lhs-15.0.0 spec/record/fetch_spec.rb
lhs-14.6.5 spec/record/fetch_spec.rb
lhs-14.6.4 spec/record/fetch_spec.rb
lhs-14.6.3 spec/record/fetch_spec.rb
lhs-14.6.2 spec/record/fetch_spec.rb