Sha256: 57ea38b4136416414755548383152fe95525c5c6efdab4521000024bff35578c

Contents?: true

Size: 453 Bytes

Versions: 105

Compression:

Stored size: 453 Bytes

Contents

require 'rails_helper'

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

  let(:item) { { name: 'Thomas' } }
  let(:body) { [item] }

  it 'converts itself to hash' do
    stub_request(:get, "http://datastore/records")
      .to_return(body: body.to_json)
    record = Record.where.first
    expect(record.to_h).to eq item
    expect(record.to_hash).to eq item
  end
end

Version data entries

105 entries across 105 versions & 1 rubygems

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