summaryrefslogtreecommitdiff
path: root/spec/validators
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-04-20 23:50:22 +0000
committerGitLab Bot <gitlab-bot@gitlab.com>2021-04-20 23:50:22 +0000
commit9dc93a4519d9d5d7be48ff274127136236a3adb3 (patch)
tree70467ae3692a0e35e5ea56bcb803eb512a10bedb /spec/validators
parent4b0f34b6d759d6299322b3a54453e930c6121ff0 (diff)
downloadgitlab-ce-9dc93a4519d9d5d7be48ff274127136236a3adb3.tar.gz
Add latest changes from gitlab-org/gitlab@13-11-stable-eev13.11.0-rc43
Diffstat (limited to 'spec/validators')
-rw-r--r--spec/validators/json_schema_validator_spec.rb30
-rw-r--r--spec/validators/x509_certificate_credentials_validator_spec.rb4
2 files changed, 3 insertions, 31 deletions
diff --git a/spec/validators/json_schema_validator_spec.rb b/spec/validators/json_schema_validator_spec.rb
index 1e9420c5422..83eb0e2f3dd 100644
--- a/spec/validators/json_schema_validator_spec.rb
+++ b/spec/validators/json_schema_validator_spec.rb
@@ -29,36 +29,6 @@ RSpec.describe JsonSchemaValidator do
expect(build_report_result.errors.full_messages).to eq(["Data must be a valid json schema"])
end
end
-
- context 'when draft is > 4' do
- let(:validator) { described_class.new(attributes: [:data], filename: "build_report_result_data", draft: 6) }
-
- it 'uses JSONSchemer to perform validations' do
- expect(JSONSchemer).to receive(:schema).with(Pathname.new(Rails.root.join('app', 'validators', 'json_schemas', 'build_report_result_data.json').to_s)).and_call_original
-
- subject
- end
- end
-
- context 'when draft is <= 4' do
- let(:validator) { described_class.new(attributes: [:data], filename: "build_report_result_data", draft: 4) }
-
- it 'uses JSON::Validator to perform validations' do
- expect(JSON::Validator).to receive(:validate).with(Rails.root.join('app', 'validators', 'json_schemas', 'build_report_result_data.json').to_s, build_report_result.data)
-
- subject
- end
- end
-
- context 'when draft value is not provided' do
- let(:validator) { described_class.new(attributes: [:data], filename: "build_report_result_data") }
-
- it 'uses JSON::Validator to perform validations' do
- expect(JSON::Validator).to receive(:validate).with(Rails.root.join('app', 'validators', 'json_schemas', 'build_report_result_data.json').to_s, build_report_result.data)
-
- subject
- end
- end
end
context 'when filename is not set' do
diff --git a/spec/validators/x509_certificate_credentials_validator_spec.rb b/spec/validators/x509_certificate_credentials_validator_spec.rb
index 9baa31c7257..9076aee7681 100644
--- a/spec/validators/x509_certificate_credentials_validator_spec.rb
+++ b/spec/validators/x509_certificate_credentials_validator_spec.rb
@@ -13,7 +13,9 @@ RSpec.describe X509CertificateCredentialsValidator do
attr_accessor :certificate, :private_key, :passphrase
def initialize(certificate, private_key, passphrase = nil)
- @certificate, @private_key, @passphrase = certificate, private_key, passphrase
+ @certificate = certificate
+ @private_key = private_key
+ @passphrase = passphrase
end
end
end