Sha256: 8de35643e3f44c18d1b8b9c0d812fa4d638a40b65537b9ce766cf99c6e7e6b4d

Contents?: true

Size: 730 Bytes

Versions: 76

Compression:

Stored size: 730 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

describe LHS::Record do
  before do
    class Record < LHS::Record
      endpoint 'http://local.ch/v2/records'
    end
  end

  it 'always returns a new chain and does not mutate the original' do
    blue_request = stub_request(:get, "http://local.ch/v2/records?color=blue").to_return(body: [].to_json)
    blue_records = Record.where(color: 'blue')
    blue_active_request = stub_request(:get, "http://local.ch/v2/records?color=blue&active=true").to_return(body: [].to_json)
    active_blue_records = blue_records.where(active: true)
    blue_records.first
    active_blue_records.first
    assert_requested(blue_request)
    assert_requested(blue_active_request)
  end
end

Version data entries

76 entries across 76 versions & 1 rubygems

Version Path
lhs-26.2.0 spec/record/immutable_chains_spec.rb
lhs-26.1.0 spec/record/immutable_chains_spec.rb
lhs-26.0.1 spec/record/immutable_chains_spec.rb
lhs-26.0.0 spec/record/immutable_chains_spec.rb
lhs-25.2.0 spec/record/immutable_chains_spec.rb
lhs-25.1.0 spec/record/immutable_chains_spec.rb
lhs-25.0.4 spec/record/immutable_chains_spec.rb
lhs-25.0.3 spec/record/immutable_chains_spec.rb
lhs-25.0.2 spec/record/immutable_chains_spec.rb
lhs-25.0.1 spec/record/immutable_chains_spec.rb
lhs-25.0.0 spec/record/immutable_chains_spec.rb
lhs-24.1.2 spec/record/immutable_chains_spec.rb
lhs-24.1.1 spec/record/immutable_chains_spec.rb
lhs-24.1.0 spec/record/immutable_chains_spec.rb
lhs-24.1.0.pre.2 spec/record/immutable_chains_spec.rb
lhs-24.1.0.pre.1 spec/record/immutable_chains_spec.rb
lhs-24.0.0 spec/record/immutable_chains_spec.rb
lhs-23.0.2 spec/record/immutable_chains_spec.rb
lhs-23.0.1 spec/record/immutable_chains_spec.rb
lhs-23.0.0 spec/record/immutable_chains_spec.rb