Sha256: 78983674a2b73aede3f5c5b78b46f02272785c2f720cf86449809ff19239e402

Contents?: true

Size: 417 Bytes

Versions: 12

Compression:

Stored size: 417 Bytes

Contents

# frozen_string_literal: true

require 'rails_helper'

describe DHS::Item do
  before do
    class Record < DHS::Record
    end
  end

  subject { Record.new }

  context 'add error' do
    it 'allows to add validation errors to the instance itself' do
      subject.errors.add(:name, 'This date is invalid')
      expect(
        subject.errors.first
      ).to eq ['name', 'This date is invalid']
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

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