summaryrefslogtreecommitdiff
path: root/spec/validators
diff options
context:
space:
mode:
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