diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-23 21:09:05 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-03-23 21:09:05 +0300 |
commit | f986ce9ffa56e25d0a3010c78d9481664742d766 (patch) | |
tree | 78101b120770aae5634b442a15e742a176f6468b /spec/validators | |
parent | c46b011d3f578d2455443dfabf24226c738c8903 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/validators')
-rw-r--r-- | spec/validators/json_schema_validator_spec.rb | 30 |
1 files changed, 0 insertions, 30 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 |