Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2020-04-02 15:08:18 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2020-04-02 15:08:18 +0300
commit684d65316ac77c62f47d68b9926eea8af30db227 (patch)
treed1f4c4eec399d7772ab4ad6294f98e7505c1cee5 /spec/lib/api/validations/validators/absence_spec.rb
parentade18c9d68d5a2e6c6e28ef7e9d3add3b3491ace (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/lib/api/validations/validators/absence_spec.rb')
-rw-r--r--spec/lib/api/validations/validators/absence_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/lib/api/validations/validators/absence_spec.rb b/spec/lib/api/validations/validators/absence_spec.rb
new file mode 100644
index 00000000000..31120979d4f
--- /dev/null
+++ b/spec/lib/api/validations/validators/absence_spec.rb
@@ -0,0 +1,23 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+describe API::Validations::Validators::Absence do
+ 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