Sha256: 29213a3080672564bb267f488bec28ecc7d650e22889ca9e0a960fa984a180c2

Contents?: true

Size: 706 Bytes

Versions: 116

Compression:

Stored size: 706 Bytes

Contents

require 'rails_helper'

describe LHS::Record do
  before(:each) 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

116 entries across 116 versions & 1 rubygems

Version Path
lhs-15.3.1 spec/record/immutable_chains_spec.rb
lhs-15.3.1.pre.fixlhc.1 spec/record/immutable_chains_spec.rb
lhs-15.3.0 spec/record/immutable_chains_spec.rb
lhs-15.2.5 spec/record/immutable_chains_spec.rb
lhs-15.2.4 spec/record/immutable_chains_spec.rb
lhs-15.2.3 spec/record/immutable_chains_spec.rb
lhs-15.2.3.pre.favorites.1 spec/record/immutable_chains_spec.rb
lhs-15.2.2.pre.favorites.1 spec/record/immutable_chains_spec.rb
lhs-15.2.2 spec/record/immutable_chains_spec.rb
lhs-15.2.1 spec/record/immutable_chains_spec.rb
lhs-15.2.0 spec/record/immutable_chains_spec.rb
lhs-15.1.1 spec/record/immutable_chains_spec.rb
lhs-15.1.0 spec/record/immutable_chains_spec.rb
lhs-15.0.2 spec/record/immutable_chains_spec.rb
lhs-15.0.1 spec/record/immutable_chains_spec.rb
lhs-15.0.0 spec/record/immutable_chains_spec.rb
lhs-14.6.5 spec/record/immutable_chains_spec.rb
lhs-14.6.4 spec/record/immutable_chains_spec.rb
lhs-14.6.3 spec/record/immutable_chains_spec.rb
lhs-14.6.2 spec/record/immutable_chains_spec.rb