diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 15:08:18 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-04-02 15:08:18 +0300 |
commit | 684d65316ac77c62f47d68b9926eea8af30db227 (patch) | |
tree | d1f4c4eec399d7772ab4ad6294f98e7505c1cee5 /spec/lib/api/validations/validators/array_none_any_spec.rb | |
parent | ade18c9d68d5a2e6c6e28ef7e9d3add3b3491ace (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/api/validations/validators/array_none_any_spec.rb')
-rw-r--r-- | spec/lib/api/validations/validators/array_none_any_spec.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/lib/api/validations/validators/array_none_any_spec.rb b/spec/lib/api/validations/validators/array_none_any_spec.rb new file mode 100644 index 00000000000..03f1c63b117 --- /dev/null +++ b/spec/lib/api/validations/validators/array_none_any_spec.rb @@ -0,0 +1,28 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe API::Validations::Validators::ArrayNoneAny do + include ApiValidatorsHelpers + + subject do + described_class.new(['test'], {}, false, scope.new) + end + + context 'valid parameters' do + it 'does not raise a validation error' do + expect_no_validation_error('test' => []) + expect_no_validation_error('test' => [1, 2, 3]) + expect_no_validation_error('test' => 'None') + expect_no_validation_error('test' => 'Any') + expect_no_validation_error('test' => 'none') + expect_no_validation_error('test' => 'any') + end + end + + context 'invalid parameters' do + it 'raises a validation error' do + expect_validation_error('test' => 'some_other_string') + end + end +end |