2020-04-02 08:08:18 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'spec_helper'
|
|
|
|
|
2020-06-24 05:08:32 -04:00
|
|
|
RSpec.describe API::Validations::Validators::Absence do
|
2020-04-02 08:08:18 -04:00
|
|
|
include ApiValidatorsHelpers
|
|
|
|
|
|
|
|
subject do
|
|
|
|
described_class.new(['test'], {}, false, scope.new)
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'empty param' do
|
|
|
|
it 'does not raise a validation error' do
|
|
|
|
expect_no_validation_error({})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'invalid parameters' do
|
|
|
|
it 'raises a validation error' do
|
|
|
|
expect_validation_error('test' => 'some_value')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|