trabajo-afectivo/spec/models/object_manager/attribute/validation/backend_examples.rb

16 lines
341 B
Ruby
Raw Normal View History

require 'rails_helper'
RSpec.shared_examples 'a validation without errors' do
it 'validatates without errors' do
subject.validate
expect(record.errors).to be_blank
end
end
RSpec.shared_examples 'a validation with errors' do
it 'validates with errors' do
subject.validate
expect(record.errors).to be_present
end
end