Sha256: 1da059066b94756e272e94ebfd3331256293a1eca569539241548be24b654a3f

Contents?: true

Size: 554 Bytes

Versions: 12

Compression:

Stored size: 554 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

describe DHS::Record do
  before do
    class Record < DHS::Record
      endpoint 'http://datastore/records/'
    end
    stub_request(:get, 'http://datastore/records/?limit=1&name=Steve&color=blue')
      .to_return(body: [{ name: 'Steve', color: 'blue' }].to_json)
  end

  it 'allows chaining find_by' do
    Record.options(params: { color: 'blue' }).find_by(name: 'Steve')
  end

  it 'allows chaining find_by!' do
    Record.options(params: { color: 'blue' }).find_by!(name: 'Steve')
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
dhs-1.6.0 spec/record/find_by_chains_spec.rb
dhs-1.5.0 spec/record/find_by_chains_spec.rb
dhs-1.4.2 spec/record/find_by_chains_spec.rb
dhs-1.4.1 spec/record/find_by_chains_spec.rb
dhs-1.4.0 spec/record/find_by_chains_spec.rb
dhs-1.3.0 spec/record/find_by_chains_spec.rb
dhs-1.2.0 spec/record/find_by_chains_spec.rb
dhs-1.1.0 spec/record/find_by_chains_spec.rb
dhs-1.0.3 spec/record/find_by_chains_spec.rb
dhs-1.0.2 spec/record/find_by_chains_spec.rb
dhs-1.0.1 spec/record/find_by_chains_spec.rb
dhs-1.0.0 spec/record/find_by_chains_spec.rb