Sha256: ae931f78922eaa346c3daea672ccc713551ecae371f923d497671f8891800882

Contents?: true

Size: 626 Bytes

Versions: 12

Compression:

Stored size: 626 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

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

  context '#assign_attributes' do
    it 'sets the attributes' do
      entry = LocalEntry.new
      entry.assign_attributes(company_name: 'depay')
      expect(entry.company_name).to eq 'depay'
    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, 'depay'])
      end.to raise_error(ArgumentError)
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

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