Sha256: 9ff65f91371a157eb4f2313c426c9e01d6cd071929c7dc9e42807692cdb16a68

Contents?: true

Size: 644 Bytes

Versions: 60

Compression:

Stored size: 644 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

describe LHS::Record do
  before do
    class LocalEntry < LHS::Record
      endpoint '{+datastore}/local-entries'
    end
  end

  context '#assign_attributes' do
    it 'sets the attributes' do
      entry = LocalEntry.new
      entry.assign_attributes(company_name: 'localsearch')
      expect(entry.company_name).to eq 'localsearch'
    end
  end

  context 'when not a hash was passed' do
    it 'raises an error' do
      entry = LocalEntry.new
      expect do
        entry.assign_attributes([:company_name, 'localsearch'])
      end.to raise_error(ArgumentError)
    end
  end
end

Version data entries

60 entries across 60 versions & 1 rubygems

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