Sha256: 0cdd85b096a73eedbce4a7c9de371b7485654198538bec8fd43a3e6b5c2d222d

Contents?: true

Size: 386 Bytes

Versions: 19

Compression:

Stored size: 386 Bytes

Contents

require 'rails_helper'

describe LHS::Item do
  before do
    class Record < LHS::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

19 entries across 19 versions & 1 rubygems

Version Path
lhs-16.1.5 spec/item/add_error_spec.rb
lhs-16.1.4 spec/item/add_error_spec.rb
lhs-16.1.3 spec/item/add_error_spec.rb
lhs-16.1.2 spec/item/add_error_spec.rb
lhs-16.1.1 spec/item/add_error_spec.rb
lhs-16.1.0 spec/item/add_error_spec.rb
lhs-16.0.1 spec/item/add_error_spec.rb
lhs-16.0.0 spec/item/add_error_spec.rb
lhs-15.7.0 spec/item/add_error_spec.rb
lhs-15.6.1 spec/item/add_error_spec.rb
lhs-15.6.0 spec/item/add_error_spec.rb
lhs-15.5.1 spec/item/add_error_spec.rb
lhs-15.5.0 spec/item/add_error_spec.rb
lhs-15.4.1 spec/item/add_error_spec.rb
lhs-15.4.0 spec/item/add_error_spec.rb
lhs-15.4.0.pre.hasone.1 spec/item/add_error_spec.rb
lhs-15.3.3 spec/item/add_error_spec.rb
lhs-15.3.3.pre.fixoptions.1 spec/item/add_error_spec.rb
lhs-15.3.2 spec/item/add_error_spec.rb