Skip to content

Commit

Permalink
Update specs
Browse files Browse the repository at this point in the history
  • Loading branch information
jefftmarks committed Dec 29, 2024
1 parent 9cfd86f commit 9a52f25
Show file tree
Hide file tree
Showing 7 changed files with 242 additions and 1 deletion.
19 changes: 19 additions & 0 deletions spec/requests/v1/gi/lcpe/exams_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe 'V1::GI::LCPE::Exams', type: :request do
include SchemaMatchers

describe 'GET v1/gi/lcpe/exams' do
context 'Retrieves exam data for GI Bill Comparison Tool' do
it 'returns 200 response' do
VCR.use_cassette('gi/lcpe/get_exams_v1') do
get v1_gi_lcpe_exams_url, params: nil
expect(response).to have_http_status(:ok)
expect(response).to match_response_schema('gi/lcpe/exams')
end
end
end
end
end
31 changes: 31 additions & 0 deletions spec/requests/v1/gi/lcpe/lacs_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# frozen_string_literal: true

require 'rails_helper'

RSpec.describe 'V1::GI::LCPE::Lacs', type: :request do
include SchemaMatchers

describe 'GET v1/gi/lcpe/lacs' do
context 'Retrieves licenses and certifications data for GI Bill Comparison Tool' do
it 'returns 200 response' do
VCR.use_cassette('gi/lcpe/get_licenses_and_certs_v1') do
get v1_gi_lcpe_lacs_url, params: nil
expect(response).to have_http_status(:ok)
expect(response).to match_response_schema('gi/lcpe/lacs')
end
end
end
end

describe 'GET v1/gi/lcpe/lacs/:id' do
context 'Retrieves license and certification details for GI Bill Comparison Tool' do
it 'returns 200 response' do
VCR.use_cassette('gi/lcpe/get_license_and_cert_details_v1') do
get v1_gi_lcpe_lacs_url + '/1@f9822'
expect(response).to have_http_status(:ok)
expect(response).to match_response_schema('gi/lcpe/lac')
end
end
end
end
end
55 changes: 55 additions & 0 deletions spec/support/schemas/gi/lcpe/exams.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"exams": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"enriched_id": {
"type": "string"
},
"name": {
"type": "string"
},
"tests": {
"type": [
"array",
"null"
],
"items": {
"type": "object",
"properties" : {
"name": {
"type": "string"
},
"fee": {
"type": ["string", "null"]
},
"begin_date": {
"type": ["string", "null"]
},
"end_date": {
"type": ["string", "null"]
}
}
}
},
"institution": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "institution.json"
}
]
}
}
}
}
}
}

62 changes: 62 additions & 0 deletions spec/support/schemas/gi/lcpe/institution.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"additionalProperties": false,
"properties": {
"name": {
"type": "string"
},
"physical_address": {
"type": "object",
"properties": {
"address_1": {
"type": ["string", "null"]
},
"address_2": {
"type": ["string", "null"]
},
"address_3": {
"type": ["string", "null"]
},
"city": {
"type": ["string", "null"]
},
"state": {
"type": ["string", "null"]
},
"zip": {
"type": ["string", "null"]
},
"country": {
"type": ["string", "null"]
}
}
},
"mailing_address": {
"type": "object",
"properties": {
"address_1": {
"type": ["string", "null"]
},
"address_2": {
"type": ["string", "null"]
},
"address_3": {
"type": ["string", "null"]
},
"city": {
"type": ["string", "null"]
},
"state": {
"type": ["string", "null"]
},
"zip": {
"type": ["string", "null"]
},
"country": {
"type": ["string", "null"]
}
}
}
}
}
49 changes: 49 additions & 0 deletions spec/support/schemas/gi/lcpe/lac.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"lac": {
"type": "object",
"additionalProperties": false,
"properties": {
"enriched_id": {
"type": "string"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
},
"tests": {
"type": [
"array",
"null"
],
"items": {
"type": "object",
"properties" : {
"name": {
"type": "string"
},
"fee": {
"type": ["string", "null"]
}
}
}
},
"institution": {
"oneOf": [
{
"type": "null"
},
{
"$ref": "institution.json"
}
]
}
}
}
}
}

25 changes: 25 additions & 0 deletions spec/support/schemas/gi/lcpe/lacs.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"lacs": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"properties": {
"enriched_id": {
"type": "string"
},
"name": {
"type": "string"
},
"type": {
"type": "string"
}
}
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 9a52f25

Please sign in to comment.