From c21d5f207fe2fb9190fdc3c08a7a43a544d33cc0 Mon Sep 17 00:00:00 2001 From: Devin McCurdy Date: Fri, 13 Sep 2019 13:53:28 -0400 Subject: [PATCH] Add 1995S form as a copy of 1995 (#3268) --- Gemfile.lock | 4 +- app/models/education_benefits_claim.rb | 4 +- app/models/form_profile.rb | 3 +- app/models/form_profiles/va1995s.rb | 11 + .../saved_claim/education_benefits/va1995s.rb | 5 + .../requests/education_benefits_claims.rb | 2 +- .../create_daily_spool_files.rb | 2 +- .../education_form/education_facility.rb | 10 +- app/workers/education_form/forms/va1995s.rb | 21 ++ .../education_form/templates/1995s.erb | 92 +++++ config/form_profile_mappings/22-1995S.yml | 5 + spec/factories/va1995s.rb | 20 ++ .../1995s/kitchen_sink.json | 76 +++++ .../1995s/kitchen_sink.spl | 120 +++++++ .../1995s/minimal.json | 22 ++ .../1995s/minimal.spl | 110 ++++++ .../education_form/create_csv_array.json | 317 +++++++++++------ .../fiscal_year_create_csv_array.json | 321 ++++++++++++------ .../education_form/ytd_day_processed.json | 42 +++ .../education_form/ytd_day_submitted.json | 42 +++ .../education_form/ytd_year_processed.json | 42 +++ .../education_form/ytd_year_submitted.json | 42 +++ ...e_daily_fiscal_year_to_date_report_spec.rb | 2 +- .../create_daily_spool_files_spec.rb | 10 + .../create_daily_year_to_date_report_spec.rb | 1 + .../education_form/education_facility_spec.rb | 25 +- spec/jobs/education_form/forms/va1995_spec.rb | 2 +- .../jobs/education_form/forms/va1995s_spec.rb | 26 ++ spec/models/education_benefits_claim_spec.rb | 20 +- .../education_benefits_submission_spec.rb | 2 +- spec/models/form_profile_spec.rb | 22 ++ 31 files changed, 1210 insertions(+), 213 deletions(-) create mode 100644 app/models/form_profiles/va1995s.rb create mode 100644 app/models/saved_claim/education_benefits/va1995s.rb create mode 100644 app/workers/education_form/forms/va1995s.rb create mode 100644 app/workers/education_form/templates/1995s.erb create mode 100644 config/form_profile_mappings/22-1995S.yml create mode 100644 spec/factories/va1995s.rb create mode 100644 spec/fixtures/education_benefits_claims/1995s/kitchen_sink.json create mode 100644 spec/fixtures/education_benefits_claims/1995s/kitchen_sink.spl create mode 100644 spec/fixtures/education_benefits_claims/1995s/minimal.json create mode 100644 spec/fixtures/education_benefits_claims/1995s/minimal.spl create mode 100644 spec/jobs/education_form/forms/va1995s_spec.rb diff --git a/Gemfile.lock b/Gemfile.lock index cd18ce0c6c7..f805585f470 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -33,10 +33,10 @@ GIT GIT remote: https://github.com/department-of-veterans-affairs/vets-json-schema - revision: 3bcb70014f04d4ed49fc14625d4298964f80a39c + revision: 8a74f697eba9c4d06951f5f6da4e42af6e21f2d5 branch: master specs: - vets_json_schema (3.138.8) + vets_json_schema (3.138.11) multi_json (~> 1.0) script_utils (= 0.0.4) diff --git a/app/models/education_benefits_claim.rb b/app/models/education_benefits_claim.rb index b0b40197558..7048e04033b 100644 --- a/app/models/education_benefits_claim.rb +++ b/app/models/education_benefits_claim.rb @@ -2,7 +2,7 @@ require 'attr_encrypted' class EducationBenefitsClaim < ApplicationRecord - FORM_TYPES = %w[1990 1995 1990e 5490 5495 1990n 0993 0994].freeze + FORM_TYPES = %w[1990 1995 1990e 5490 5495 1990n 0993 0994 1995s].freeze APPLICATION_TYPES = %w[ chapter33 @@ -114,6 +114,8 @@ def selected_benefits return benefits when '0994' benefits['vettec'] = true + when '1995s' + benefits['chapter33'] = true else benefit = parsed_form['benefit']&.underscore benefits[benefit] = true if benefit.present? diff --git a/app/models/form_profile.rb b/app/models/form_profile.rb index 505cf8d18e3..ba2208798d6 100644 --- a/app/models/form_profile.rb +++ b/app/models/form_profile.rb @@ -84,7 +84,7 @@ class FormProfile MAPPINGS = Dir[Rails.root.join('config', 'form_profile_mappings', '*.yml')].map { |f| File.basename(f, '.*') } - EDU_FORMS = ['22-1990', '22-1990N', '22-1990E', '22-1995', '22-5490', + EDU_FORMS = ['22-1990', '22-1990N', '22-1990E', '22-1995', '22-1995S', '22-5490', '22-5495', '22-0993', '22-0994', 'FEEDBACK-TOOL'].freeze EVSS_FORMS = ['21-526EZ'].freeze HCA_FORMS = ['1010ez'].freeze @@ -98,6 +98,7 @@ class FormProfile '22-1990N' => ::FormProfiles::VA1990n, '22-1990E' => ::FormProfiles::VA1990e, '22-1995' => ::FormProfiles::VA1995, + '22-1995S' => ::FormProfiles::VA1995s, '22-5490' => ::FormProfiles::VA5490, '22-5495' => ::FormProfiles::VA5495, '21P-530' => ::FormProfiles::VA21p530, diff --git a/app/models/form_profiles/va1995s.rb b/app/models/form_profiles/va1995s.rb new file mode 100644 index 00000000000..42c73a45fc3 --- /dev/null +++ b/app/models/form_profiles/va1995s.rb @@ -0,0 +1,11 @@ +# frozen_string_literal: true + +class FormProfiles::VA1995s < FormProfile + def metadata + { + version: 0, + prefill: true, + returnUrl: '/applicant/information' + } + end +end diff --git a/app/models/saved_claim/education_benefits/va1995s.rb b/app/models/saved_claim/education_benefits/va1995s.rb new file mode 100644 index 00000000000..7f4a8f4a827 --- /dev/null +++ b/app/models/saved_claim/education_benefits/va1995s.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +class SavedClaim::EducationBenefits::VA1995s < SavedClaim::EducationBenefits + add_form_and_validation('22-1995S') +end diff --git a/app/swagger/requests/education_benefits_claims.rb b/app/swagger/requests/education_benefits_claims.rb index 3b33fea7f9c..2002d0f5e04 100644 --- a/app/swagger/requests/education_benefits_claims.rb +++ b/app/swagger/requests/education_benefits_claims.rb @@ -26,7 +26,7 @@ class EducationBenefitsClaims parameter do key :name, :form_type key :in, :path - key :description, 'Form code. Allowed values: 1990 1995 1990e 5490' + key :description, 'Form code. Allowed values: 1990 1995 1990e 5490 1995s' key :required, true key :type, :string end diff --git a/app/workers/education_form/create_daily_spool_files.rb b/app/workers/education_form/create_daily_spool_files.rb index 9503dbd77e4..cf1cc0415cd 100644 --- a/app/workers/education_form/create_daily_spool_files.rb +++ b/app/workers/education_form/create_daily_spool_files.rb @@ -11,7 +11,7 @@ class FormattingError < StandardError end class CreateDailySpoolFiles - LIVE_FORM_TYPES = %w[1990 1995 1990e 5490 1990n 5495 0993 0994].map { |t| "22-#{t.upcase}" }.freeze + LIVE_FORM_TYPES = %w[1990 1995 1995s 1990e 5490 1990n 5495 0993 0994].map { |t| "22-#{t.upcase}" }.freeze include Sidekiq::Worker include SentryLogging sidekiq_options queue: 'default', diff --git a/app/workers/education_form/education_facility.rb b/app/workers/education_form/education_facility.rb index 3653bd7fb2d..135efb86004 100644 --- a/app/workers/education_form/education_facility.rb +++ b/app/workers/education_form/education_facility.rb @@ -75,8 +75,8 @@ def self.region_for(model) # special case 0994 return :eastern if model.form_type == '0994' - # special case 1995 STEM - return :eastern if model.form_type == '1995' && record.isEdithNourseRogersScholarship + # special case 1995 with STEM / 1995s + return :eastern if check_stem_routing(model, record) # special case Philippines return :western if address&.country == 'PHL' @@ -84,6 +84,10 @@ def self.region_for(model) check_area(address) end + def self.check_stem_routing(model, record) + model.form_type == '1995s' || (model.form_type == '1995' && record.isEdithNourseRogersScholarship) + end + def self.check_area(address) area = address&.state case area @@ -114,7 +118,7 @@ def self.routing_address(record, form_type:) record.educationProgram&.address || record.veteranAddress when '1990E', '5490', '5495' record.educationProgram&.address || record.relativeAddress - when '1995' + when '1995', '1995s' record.newSchool&.address || record.veteranAddress end end diff --git a/app/workers/education_form/forms/va1995s.rb b/app/workers/education_form/forms/va1995s.rb new file mode 100644 index 00000000000..d9ad9e8aafd --- /dev/null +++ b/app/workers/education_form/forms/va1995s.rb @@ -0,0 +1,21 @@ +# frozen_string_literal: true + +module EducationForm::Forms + class VA1995s < Base + def school + @applicant.newSchool + end + + def form_type + 'CH33' + end + + def form_benefit + 'STEM' + end + + def header_form_type + 'STEM1995' + end + end +end diff --git a/app/workers/education_form/templates/1995s.erb b/app/workers/education_form/templates/1995s.erb new file mode 100644 index 00000000000..6da732f3bb7 --- /dev/null +++ b/app/workers/education_form/templates/1995s.erb @@ -0,0 +1,92 @@ +<%= header %> +CH33 +*START* +VA Form 22-1995 +DEC 2016 + + + REQUEST FOR CHANGE OF PROGRAM OR PLACE OF TRAINING + FOR VETERANS, SERVICEPERSONS & MEMBERS OF THE SELECTED RESERVE + ------------------------------------- + + APPLICANT INFORMATION + --------------------- + +SSN: <%= value_or_na(@applicant.veteranSocialSecurityNumber) %> VA File Number: <%= value_or_na(@applicant.vaFileNumber) %> + +Name: <%= full_name(@applicant.veteranFullName) %> + +Address: +<%= full_address(@applicant.veteranAddress) %> + +<%= parse_with_template_path('phone_numbers') %> + +Email Address: <%= @applicant.email %> +Preferred Method of Contact: <%= @applicant.preferredContactMethod %> + +<%= parse_with_template_path('bank_account') %> + + TYPE AND PROGRAM OF EDUCATION OR TRAINING + ----------------------------------------- + +Benefit You Are Receiving: STEM +Are you applying for the Edith Nourse Rogers STEM Scholarship +(Chapter 33)?: <%= yesno(@applicant.isEdithNourseRogersScholarship) %> +Are you enrolled in an undergraduate STEM degree program?: <%= yesno(@applicant.isEnrolledStem) %> +Do you have a STEM undergraduate degree and are now pursuing a +teaching certification?: <%= yesno(@applicant.isPursuingTeachingCert) %> + +Type of Education or Training: <%= @applicant.educationType&.titleize %> +Education or Career Goal: <%= @applicant.educationObjective %> + +New School or Training Establishment: +<%= school_name_and_addr(@applicant.newSchool) %> + +Current/Prior School or Training Establishment: +<%= school_name_and_addr(@applicant.oldSchool) %> + +Date You Stopped Training: <%= @applicant.trainingEndDate %> +Reason for Change: <%= @applicant.reasonForChange %> + + + ACTIVE DUTY SERVICE INFORMATION + ------------------------------- + +Are you currently on active duty or do you anticipate you will +be going on active duty?: <%= yesno(@applicant.isActiveDuty) %> + +Date Entered Date Separated Service Component +<% @applicant&.toursOfDuty&.each do |tour| -%> +<%= to_date(tour.dateRange&.from) %> <%= to_date(tour.dateRange&.to) %> <%= tour.serviceBranch %> +<% end %> + + + ENTITLEMENT TO AND USAGE OF ADDITIONAL TYPES OF ASSISTANCE + ---------------------------------------------------------- + +For Active Duty Claimants Only. Are you receiving or do you anticipate receiving any money (including but not limited to Federal Tuition Assistance) from the Armed Forces or Public Health Service for the course for which you have applied to the VA for Education Benefits? If you receive such benefits during any part of your training, check 'Yes.' Note: If you are only applying for Tuition Assistance Top-Up, check 'No' to this item. <%= yesno(@applicant.nonVaAssistance) %> + +For Civilian Employees of the U.S. Federal Government Only. Are you receiving or do you anticipate receiving any money from your agency (including but not limited to the Government Employees Training Act) for the same period for which you have applied to the VA for Education Benefits? If you will receive such benefits during any part of your training, check Yes. <%= yesno(@applicant.civilianBenefitsAssistance) %> + + + MARITAL AND DEPENDENCY STATUS + (For Applicants with Military Service Before Jan 1, 1977) + --------------------------------------------------------- + + +<% if @applicant.serviceBefore1977 -%> +Married: <%= yesno(@applicant.serviceBefore1977.married) %> +Has Dependents: <%= yesno(@applicant.serviceBefore1977.haveDependents) %> +Parent Dependent: <%= yesno(@applicant.serviceBefore1977.parentDependent) %> +<% else -%> +N/A +<% end -%> + + + Certification and Signature of Applicant +Signature of Applicant Date + + Certification for Persons on Active Duty +Signature/Title/Branch of Armed Forces Education Service Officer Date + +<%= parse_with_template_path('footer') %> diff --git a/config/form_profile_mappings/22-1995S.yml b/config/form_profile_mappings/22-1995S.yml new file mode 100644 index 00000000000..0a863d7f748 --- /dev/null +++ b/config/form_profile_mappings/22-1995S.yml @@ -0,0 +1,5 @@ +veteranFullName: [identity_information, full_name] +veteranSocialSecurityNumber: [identity_information, ssn] +homePhone: [contact_information, us_phone] +veteranAddress: [contact_information, address] +email: [contact_information, email] diff --git a/spec/factories/va1995s.rb b/spec/factories/va1995s.rb new file mode 100644 index 00000000000..fe94129fdad --- /dev/null +++ b/spec/factories/va1995s.rb @@ -0,0 +1,20 @@ +# frozen_string_literal: true + +FactoryBot.define do + factory :va1995s, class: SavedClaim::EducationBenefits::VA1995s, parent: :education_benefits do + form({ + veteranFullName: { + first: 'Mark', + last: 'Olson' + }, + veteranSocialSecurityNumber: '111223334', + benefit: 'transferOfEntitlement', + isEdithNourseRogersScholarship: true, + privacyAgreementAccepted: true + }.to_json) + + factory :va1995s_full_form do + form(File.read(Rails.root.join('spec', 'fixtures', 'education_benefits_claims', '1995s', 'kitchen_sink.json'))) + end + end +end diff --git a/spec/fixtures/education_benefits_claims/1995s/kitchen_sink.json b/spec/fixtures/education_benefits_claims/1995s/kitchen_sink.json new file mode 100644 index 00000000000..3fcca6c123f --- /dev/null +++ b/spec/fixtures/education_benefits_claims/1995s/kitchen_sink.json @@ -0,0 +1,76 @@ +{ + "veteranFullName": { + "first": "first", + "middle": "middle", + "last": "last" + }, + "veteranSocialSecurityNumber": "111223333", + "newSchool": { + "name": "Test School Name", + "address": { + "city": "Milwaukee", + "country": "USA", + "postalCode": "53135", + "state": "WI", + "street": "111 Uni Drive" + } + }, + "oldSchool": { + "name": "old school name", + "address": { + "city": "Anytown", + "country": "USA", + "postalCode": "41414", + "state": "MA", + "street": "2222 Uni Drive" + } + }, + "preferredContactMethod": "email", + "trainingEndDate": "2007-06-XX", + "reasonForChange": "reason for change", + "vaFileNumber": "c12345678", + "homePhone": "5551110000", + "mobilePhone": "5551110001", + "veteranAddress": { + "city": "Milwaukee", + "country": "USA", + "postalCode": "53130", + "state": "WI", + "street": "123 Main St" + }, + "civilianBenefitsAssistance": true, + "email": "test@sample.com", + "benefit": "chapter33", + "educationType": "tuitionTopUp", + "educationObjective": "bachelor's degree", + "bankAccountChange": "startUpdate", + "bankAccount": { + "accountNumber": "88888888888", + "accountType": "checking", + "bankName": "First Bank of JSON", + "routingNumber": "123456789" + }, + "serviceBefore1977": { + "haveDependents": true, + "married": true, + "parentDependent": false + }, + "toursOfDuty": [{ + "dateRange": { + "from": "2012-06-26", + "to": "2013-04-10" + }, + "serviceBranch": "Army Reserve" + }, { + "dateRange": { + "from": "2013-04-22", + "to": "2013-06-14" + }, + "serviceBranch": "navy" + }], + "nonVaAssistance": true, + "remarks": "remarks", + "programName": "program name", + "isEdithNourseRogersScholarship": true, + "privacyAgreementAccepted": true +} diff --git a/spec/fixtures/education_benefits_claims/1995s/kitchen_sink.spl b/spec/fixtures/education_benefits_claims/1995s/kitchen_sink.spl new file mode 100644 index 00000000000..71aacf343a7 --- /dev/null +++ b/spec/fixtures/education_benefits_claims/1995s/kitchen_sink.spl @@ -0,0 +1,120 @@ +*INIT* +FIRST +MIDDLE +LAST +111223333 +111223333 +STEM1995 + +TEST SCHOOL NAME +CH33 +*START* +VA Form 22-1995 +DEC 2016 + + + REQUEST FOR CHANGE OF PROGRAM OR PLACE OF TRAINING + FOR VETERANS, SERVICEPERSONS & MEMBERS OF THE SELECTED RESERVE + ------------------------------------- + + APPLICANT INFORMATION + --------------------- + +SSN: 111223333 VA File Number: c12345678 + +Name: first middle last + +Address: +123 MAIN ST +MILWAUKEE, WI, 53130 +USA + +Telephone Numbers: Primary: 5551110000 + Secondary: 5551110001 + +Email Address: test@sample.com +Preferred Method of Contact: email + +Direct Deposit: Start or Update EFT +Type of Account: checking +Name of Financial Inst.: First Bank of JSON +Routing/Transit #: 123456789 Account #: 88888888888 + + TYPE AND PROGRAM OF EDUCATION OR TRAINING + ----------------------------------------- + +Benefit You Are Receiving: STEM +Are you applying for the Edith Nourse Rogers STEM Scholarship +(Chapter 33)?: YES +Are you enrolled in an undergraduate STEM degree program?: N/A +Do you have a STEM undergraduate degree and are now pursuing a +teaching certification?: N/A + +Type of Education or Training: Tuition Top Up +Education or Career Goal: bachelor's degree + +New School or Training Establishment: +Test School Name +111 UNI DRIVE +MILWAUKEE, WI, 53135 +USA + +Current/Prior School or Training Establishment: +old school name +2222 UNI DRIVE +ANYTOWN, MA, 41414 +USA + +Date You Stopped Training: 2007-06-XX +Reason for Change: reason for change + + + ACTIVE DUTY SERVICE INFORMATION + ------------------------------- + +Are you currently on active duty or do you anticipate you will +be going on active duty?: N/A + +Date Entered Date Separated Service Component +2012-06-26 2013-04-10 Army Reserve +2013-04-22 2013-06-14 navy + + + + ENTITLEMENT TO AND USAGE OF ADDITIONAL TYPES OF ASSISTANCE + ---------------------------------------------------------- + +For Active Duty Claimants Only. Are you receiving or do you anticipate +receiving any money (including but not limited to Federal Tuition Assistance) +from the Armed Forces or Public Health Service for the course for which you +have applied to the VA for Education Benefits? If you receive such benefits +during any part of your training, check 'Yes.' Note: If you are only applying +for Tuition Assistance Top-Up, check 'No' to this item. YES + +For Civilian Employees of the U.S. Federal Government Only. Are you receiving +or do you anticipate receiving any money from your agency (including but not +limited to the Government Employees Training Act) for the same period for +which you have applied to the VA for Education Benefits? If you will receive +such benefits during any part of your training, check Yes. YES + + + MARITAL AND DEPENDENCY STATUS + (For Applicants with Military Service Before Jan 1, 1977) + --------------------------------------------------------- + + +Married: YES +Has Dependents: YES +Parent Dependent: NO + + + Certification and Signature of Applicant +Signature of Applicant Date + + Certification for Persons on Active Duty +Signature/Title/Branch of Armed Forces Education Service Officer Date + +Electronically Received by VA: 2017-01-17 +Confirmation #: V-EBC-1 + +*END* diff --git a/spec/fixtures/education_benefits_claims/1995s/minimal.json b/spec/fixtures/education_benefits_claims/1995s/minimal.json new file mode 100644 index 00000000000..a0f2c107f09 --- /dev/null +++ b/spec/fixtures/education_benefits_claims/1995s/minimal.json @@ -0,0 +1,22 @@ +{ + "privacyAgreementAccepted": true, + "veteranFullName": { + "first": "Test", + "last": "Fake" + }, + "vaFileNumber": "12345678", + "newSchool": {}, + "oldSchool": {}, + "toursOfDuty": [{ + "serviceBranch": "Army" + }], + "preferredContactMethod": "mail", + "veteranAddress": { + "street": "123 Central St", + "city": "Baltimore", + "country": "USA", + "state": "MD", + "postalCode": "21231" + }, + "email": "test@sample.com", + "bankAccount": {}} diff --git a/spec/fixtures/education_benefits_claims/1995s/minimal.spl b/spec/fixtures/education_benefits_claims/1995s/minimal.spl new file mode 100644 index 00000000000..f04ef10f8be --- /dev/null +++ b/spec/fixtures/education_benefits_claims/1995s/minimal.spl @@ -0,0 +1,110 @@ +*INIT* +TEST + +FAKE + + +STEM1995 + + +CH33 +*START* +VA Form 22-1995 +DEC 2016 + + + REQUEST FOR CHANGE OF PROGRAM OR PLACE OF TRAINING + FOR VETERANS, SERVICEPERSONS & MEMBERS OF THE SELECTED RESERVE + ------------------------------------- + + APPLICANT INFORMATION + --------------------- + +SSN: N/A VA File Number: 12345678 + +Name: Test Fake + +Address: +123 CENTRAL ST +BALTIMORE, MD, 21231 +USA + +Telephone Numbers: Primary: + Secondary: + +Email Address: test@sample.com +Preferred Method of Contact: mail + +Direct Deposit: Type of Account: +Name of Financial Inst.: +Routing/Transit #: Account #: + + TYPE AND PROGRAM OF EDUCATION OR TRAINING + ----------------------------------------- + +Benefit You Are Receiving: STEM +Are you applying for the Edith Nourse Rogers STEM Scholarship +(Chapter 33)?: N/A +Are you enrolled in an undergraduate STEM degree program?: N/A +Do you have a STEM undergraduate degree and are now pursuing a +teaching certification?: N/A + +Type of Education or Training: +Education or Career Goal: + +New School or Training Establishment: + + +Current/Prior School or Training Establishment: + + +Date You Stopped Training: +Reason for Change: + + + ACTIVE DUTY SERVICE INFORMATION + ------------------------------- + +Are you currently on active duty or do you anticipate you will +be going on active duty?: N/A + +Date Entered Date Separated Service Component + Army + + + + ENTITLEMENT TO AND USAGE OF ADDITIONAL TYPES OF ASSISTANCE + ---------------------------------------------------------- + +For Active Duty Claimants Only. Are you receiving or do you anticipate +receiving any money (including but not limited to Federal Tuition Assistance) +from the Armed Forces or Public Health Service for the course for which you +have applied to the VA for Education Benefits? If you receive such benefits +during any part of your training, check 'Yes.' Note: If you are only applying +for Tuition Assistance Top-Up, check 'No' to this item. N/A + +For Civilian Employees of the U.S. Federal Government Only. Are you receiving +or do you anticipate receiving any money from your agency (including but not +limited to the Government Employees Training Act) for the same period for +which you have applied to the VA for Education Benefits? If you will receive +such benefits during any part of your training, check Yes. N/A + + + MARITAL AND DEPENDENCY STATUS + (For Applicants with Military Service Before Jan 1, 1977) + --------------------------------------------------------- + + +N/A + + + Certification and Signature of Applicant +Signature of Applicant Date + + Certification for Persons on Active Duty +Signature/Title/Branch of Armed Forces Education Service Officer Date + +Electronically Received by VA: 2017-01-17 +Confirmation #: V-EBC-1 + +*END* diff --git a/spec/fixtures/education_form/create_csv_array.json b/spec/fixtures/education_form/create_csv_array.json index d140333c360..567d202ded7 100644 --- a/spec/fixtures/education_form/create_csv_array.json +++ b/spec/fixtures/education_form/create_csv_array.json @@ -33,6 +33,9 @@ "", "22-0994", "", + "", + "22-1995s", + "", "" ], [ @@ -61,6 +64,9 @@ "2017-01-03 00:00:00 UTC..2017-01-03 23:59:59 UTC", "2017-01-01..2017-01-03 23:59:59 UTC", "", + "2017-01-03 00:00:00 UTC..2017-01-03 23:59:59 UTC", + "2017-01-01..2017-01-03 23:59:59 UTC", + "", "2017-01-03 00:00:00 UTC..2017-01-03 23:59:59 UTC" ], [ @@ -89,6 +95,9 @@ "Sent to Spool File", "", "Submitted", + "Sent to Spool File", + "", + "Submitted", "Sent to Spool File" ], [ @@ -117,6 +126,9 @@ "", 0, 0, + 0, + 0, + 1, 0 ], [ @@ -145,6 +157,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -173,6 +188,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -201,6 +219,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -229,6 +250,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -257,35 +281,41 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ "", "vettec", - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - "", - "", - "", - "", - "", - "", - 0, - 1, - 0 + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + "", + "", + "", + "", + "", + "", + 0, + 1, + 0, + 0, + 0, + 0 ], [ "", @@ -313,6 +343,9 @@ 0, 0, 0, + 0, + 0, + 0, 0 ], [ @@ -341,6 +374,9 @@ 0, 0, 1, + 0, + 0, + 1, 0 ], [ @@ -369,6 +405,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -397,6 +436,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -425,6 +467,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -453,6 +498,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -481,6 +529,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -509,35 +560,41 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ "", "vettec", - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - "", - "", - "", - "", - "", - "", - 0, - 0, - 0 + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + "", + "", + "", + "", + "", + "", + 0, + 0, + 0, + 0, + 0, + 0 ], [ "", @@ -565,6 +622,9 @@ 0, 0, 0, + 0, + 0, + 0, 0 ], [ @@ -593,6 +653,9 @@ 0, 0, 0, + 0, + 0, + 0, 0 ], [ @@ -621,6 +684,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -649,6 +715,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -677,6 +746,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -705,6 +777,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -733,6 +808,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -761,35 +839,41 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ "", "vettec", - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - "", - "", - "", - "", - "", - "", - 0, - 0, - 0 + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + "", + "", + "", + "", + "", + "", + 0, + 0, + 0, + 0, + 0, + 0 ], [ "", @@ -817,6 +901,9 @@ 0, 0, 0, + 0, + 0, + 0, 0 ], [ @@ -845,6 +932,9 @@ 0, 0, 0, + 0, + 0, + 0, 0 ], [ @@ -873,6 +963,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -901,6 +994,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -929,6 +1025,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -957,6 +1056,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -985,6 +1087,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -1013,35 +1118,41 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ "", "vettec", - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - "", - "", - "", - "", - "", - "", - 0, - 0, - 0 + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + "", + "", + "", + "", + "", + "", + 0, + 0, + 0, + 0, + 0, + 0 ], [ "", @@ -1069,6 +1180,9 @@ 0, 0, 0, + 0, + 0, + 0, 0 ], [ @@ -1097,6 +1211,9 @@ 0, 0, 0, + 0, + 0, + 0, 0 ], [ @@ -1125,6 +1242,9 @@ 0, 0, 1, + 0, + 0, + 1, 0 ], [ @@ -1153,6 +1273,9 @@ "", "22-0994", "", + "", + "22-1995s", + "", "" ] -] +] \ No newline at end of file diff --git a/spec/fixtures/education_form/fiscal_year_create_csv_array.json b/spec/fixtures/education_form/fiscal_year_create_csv_array.json index b1d5c5fdd6a..431df22e047 100644 --- a/spec/fixtures/education_form/fiscal_year_create_csv_array.json +++ b/spec/fixtures/education_form/fiscal_year_create_csv_array.json @@ -33,6 +33,9 @@ "", "22-0994", "", + "", + "22-1995s", + "", "" ], [ @@ -56,8 +59,11 @@ "2016-10-01..2017-01-03 23:59:59 UTC", "", "2017-01-03 00:00:00 UTC..2017-01-03 23:59:59 UTC", - "2016-10-01..2017-01-03 23:59:59 UTC", - "", + "2016-10-01..2017-01-03 23:59:59 UTC", + "", + "2017-01-03 00:00:00 UTC..2017-01-03 23:59:59 UTC", + "2016-10-01..2017-01-03 23:59:59 UTC", + "", "2017-01-03 00:00:00 UTC..2017-01-03 23:59:59 UTC", "2016-10-01..2017-01-03 23:59:59 UTC", "", @@ -89,6 +95,9 @@ "Sent to Spool File", "", "Submitted", + "Sent to Spool File", + "", + "Submitted", "Sent to Spool File" ], [ @@ -117,6 +126,9 @@ "", 0, 0, + 0, + 0, + 1, 0 ], [ @@ -145,6 +157,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -173,6 +188,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -201,6 +219,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -229,6 +250,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -257,35 +281,41 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ "", "vettec", - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - "", - "", - "", - "", - "", - "", - 0, - 1, - 0 + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + "", + "", + "", + "", + "", + "", + 0, + 1, + 0, + 0, + 0, + 0 ], [ "", @@ -313,6 +343,9 @@ 0, 0, 0, + 0, + 0, + 0, 0 ], [ @@ -341,6 +374,9 @@ 0, 0, 1, + 0, + 0, + 1, 0 ], [ @@ -369,6 +405,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -397,6 +436,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -425,6 +467,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -453,6 +498,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -481,6 +529,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -509,35 +560,41 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ "", "vettec", - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - "", - "", - "", - "", - "", - "", - 0, - 0, - 0 + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + "", + "", + "", + "", + "", + "", + 0, + 0, + 0, + 0, + 0, + 0 ], [ "", @@ -565,6 +622,9 @@ 0, 0, 0, + 0, + 0, + 0, 0 ], [ @@ -593,6 +653,9 @@ 0, 0, 0, + 0, + 0, + 0, 0 ], [ @@ -621,6 +684,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -649,6 +715,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -677,6 +746,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -705,6 +777,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -733,6 +808,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -761,35 +839,41 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ "", "vettec", - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - "", - "", - "", - "", - "", - "", - 0, - 0, - 0 + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + "", + "", + "", + "", + "", + "", + 0, + 0, + 0, + 0, + 0, + 0 ], [ "", @@ -817,6 +901,9 @@ 0, 0, 0, + 0, + 0, + 0, 0 ], [ @@ -845,6 +932,9 @@ 0, 0, 0, + 0, + 0, + 0, 0 ], [ @@ -873,6 +963,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -901,6 +994,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -929,6 +1025,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -957,6 +1056,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -985,6 +1087,9 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ @@ -1013,35 +1118,41 @@ "", 0, 0, + 0, + 0, + 0, 0 ], [ "", "vettec", - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0, - "", - "", - "", - "", - "", - "", - 0, - 0, - 0 + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0, + "", + "", + "", + "", + "", + "", + 0, + 0, + 0, + 0, + 0, + 0 ], [ "", @@ -1069,6 +1180,9 @@ 0, 0, 0, + 0, + 0, + 0, 0 ], [ @@ -1097,6 +1211,9 @@ 0, 0, 0, + 0, + 0, + 0, 0 ], [ @@ -1125,6 +1242,9 @@ 0, 0, 1, + 0, + 0, + 1, 0 ], [ @@ -1153,6 +1273,9 @@ "", "22-0994", "", + "", + "22-1995s", + "", "" ] -] +] \ No newline at end of file diff --git a/spec/fixtures/education_form/ytd_day_processed.json b/spec/fixtures/education_form/ytd_day_processed.json index 5453450c6d2..77bf5f2cebe 100644 --- a/spec/fixtures/education_form/ytd_day_processed.json +++ b/spec/fixtures/education_form/ytd_day_processed.json @@ -278,5 +278,47 @@ "chapter1607": 0, "vettec": 0 } + }, + "1995s": { + "eastern": { + "chapter33":0, + "chapter1607":0, + "chapter1606":0, + "chapter32":0, + "chapter35":0, + "transfer_of_entitlement":0, + "vettec":0, + "chapter30":0 + }, + "southern": { + "chapter33":0, + "chapter1607":0, + "chapter1606":0, + "chapter32":0, + "chapter35":0, + "transfer_of_entitlement":0, + "vettec":0, + "chapter30":0 + }, + "central": { + "chapter33":0, + "chapter1607":0, + "chapter1606":0, + "chapter32":0, + "chapter35":0, + "transfer_of_entitlement":0, + "vettec":0, + "chapter30":0 + }, + "western": { + "chapter33":0, + "chapter1607":0, + "chapter1606":0, + "chapter32":0, + "chapter35":0, + "transfer_of_entitlement":0, + "vettec":0, + "chapter30":0 + } } } diff --git a/spec/fixtures/education_form/ytd_day_submitted.json b/spec/fixtures/education_form/ytd_day_submitted.json index 7064091e1d4..f7afcb12966 100644 --- a/spec/fixtures/education_form/ytd_day_submitted.json +++ b/spec/fixtures/education_form/ytd_day_submitted.json @@ -278,5 +278,47 @@ "chapter1607": 0, "vettec": 0 } + }, + "1995s": { + "eastern": { + "chapter33":1, + "chapter1607":0, + "chapter1606":0, + "chapter32":0, + "chapter35":0, + "transfer_of_entitlement":0, + "vettec":0, + "chapter30":0 + }, + "southern": { + "chapter33":0, + "chapter1607":0, + "chapter1606":0, + "chapter32":0, + "chapter35":0, + "transfer_of_entitlement":0, + "vettec":0, + "chapter30":0 + }, + "central": { + "chapter33":0, + "chapter1607":0, + "chapter1606":0, + "chapter32":0, + "chapter35":0, + "transfer_of_entitlement":0, + "vettec":0, + "chapter30":0 + }, + "western": { + "chapter33":0, + "chapter1607":0, + "chapter1606":0, + "chapter32":0, + "chapter35":0, + "transfer_of_entitlement":0, + "vettec":0, + "chapter30":0 + } } } diff --git a/spec/fixtures/education_form/ytd_year_processed.json b/spec/fixtures/education_form/ytd_year_processed.json index 62abf53aed0..c2dd3b472d4 100644 --- a/spec/fixtures/education_form/ytd_year_processed.json +++ b/spec/fixtures/education_form/ytd_year_processed.json @@ -278,5 +278,47 @@ "chapter1607": 0, "vettec": 0 } + }, + "1995s": { + "eastern": { + "chapter33":0, + "chapter1607":0, + "chapter1606":0, + "chapter32":0, + "chapter35":0, + "transfer_of_entitlement":0, + "vettec":0, + "chapter30":0 + }, + "southern": { + "chapter33":0, + "chapter1607":0, + "chapter1606":0, + "chapter32":0, + "chapter35":0, + "transfer_of_entitlement":0, + "vettec":0, + "chapter30":0 + }, + "central": { + "chapter33":0, + "chapter1607":0, + "chapter1606":0, + "chapter32":0, + "chapter35":0, + "transfer_of_entitlement":0, + "vettec":0, + "chapter30":0 + }, + "western": { + "chapter33":0, + "chapter1607":0, + "chapter1606":0, + "chapter32":0, + "chapter35":0, + "transfer_of_entitlement":0, + "vettec":0, + "chapter30":0 + } } } diff --git a/spec/fixtures/education_form/ytd_year_submitted.json b/spec/fixtures/education_form/ytd_year_submitted.json index ce8df63cc60..81d7910e568 100644 --- a/spec/fixtures/education_form/ytd_year_submitted.json +++ b/spec/fixtures/education_form/ytd_year_submitted.json @@ -278,5 +278,47 @@ "chapter1607": 0, "vettec": 0 } + }, + "1995s": { + "eastern": { + "chapter33":1, + "chapter1607":0, + "chapter1606":0, + "chapter32":0, + "chapter35":0, + "transfer_of_entitlement":0, + "vettec":0, + "chapter30":0 + }, + "southern": { + "chapter33":0, + "chapter1607":0, + "chapter1606":0, + "chapter32":0, + "chapter35":0, + "transfer_of_entitlement":0, + "vettec":0, + "chapter30":0 + }, + "central": { + "chapter33":0, + "chapter1607":0, + "chapter1606":0, + "chapter32":0, + "chapter35":0, + "transfer_of_entitlement":0, + "vettec":0, + "chapter30":0 + }, + "western": { + "chapter33":0, + "chapter1607":0, + "chapter1606":0, + "chapter32":0, + "chapter35":0, + "transfer_of_entitlement":0, + "vettec":0, + "chapter30":0 + } } } diff --git a/spec/jobs/education_form/create_daily_fiscal_year_to_date_report_spec.rb b/spec/jobs/education_form/create_daily_fiscal_year_to_date_report_spec.rb index d708cac0276..5bf7c913984 100644 --- a/spec/jobs/education_form/create_daily_fiscal_year_to_date_report_spec.rb +++ b/spec/jobs/education_form/create_daily_fiscal_year_to_date_report_spec.rb @@ -73,7 +73,7 @@ def get_education_form_fixture(filename) create(:education_benefits_submission, created_at: date - 26.hours, status: 'processed') create(:education_benefits_submission, created_at: date, status: 'submitted') - %w[1995 1990e 5490 1990n 5495].each do |form_type| + %w[1995 1990e 5490 1990n 5495 1995s].each do |form_type| create(:education_benefits_submission, form_type: form_type, created_at: date) end create(:education_benefits_submission, form_type: '0993', created_at: date, region: :western) diff --git a/spec/jobs/education_form/create_daily_spool_files_spec.rb b/spec/jobs/education_form/create_daily_spool_files_spec.rb index 12c6fd84f28..8f843d21407 100644 --- a/spec/jobs/education_form/create_daily_spool_files_spec.rb +++ b/spec/jobs/education_form/create_daily_spool_files_spec.rb @@ -87,6 +87,16 @@ end end + context 'with a 1995s form' do + let(:application_1606) { create(:va1995s_full_form).education_benefits_claim } + + it 'tracks the 1995s form' do + expect(subject).to receive(:track_form_type).with('22-1995s', 999) + result = subject.format_application(application_1606, rpo: 999) + expect(result).to be_a(EducationForm::Forms::VA1995s) + end + end + context 'result tests' do subject { described_class.new.format_application(application_1606).text } diff --git a/spec/jobs/education_form/create_daily_year_to_date_report_spec.rb b/spec/jobs/education_form/create_daily_year_to_date_report_spec.rb index 7f1ff4c25f3..66a6fee1041 100644 --- a/spec/jobs/education_form/create_daily_year_to_date_report_spec.rb +++ b/spec/jobs/education_form/create_daily_year_to_date_report_spec.rb @@ -43,6 +43,7 @@ def get_education_form_fixture(filename) create(:education_benefits_submission, form_type: '0993', created_at: date, region: :western) create(:education_benefits_submission, form_type: '0994', created_at: date, region: :eastern, vettec: true, chapter33: false) + create(:education_benefits_submission, form_type: '1995s', created_at: date, region: :eastern, chapter33: true) end context 'with the date variable set' do diff --git a/spec/jobs/education_form/education_facility_spec.rb b/spec/jobs/education_form/education_facility_spec.rb index 94a08b80d13..dae0f1c357f 100644 --- a/spec/jobs/education_form/education_facility_spec.rb +++ b/spec/jobs/education_form/education_facility_spec.rb @@ -100,13 +100,11 @@ def school(data) education_benefits_claim.saved_claim.form_id = '22-1995' expect(described_class.region_for(education_benefits_claim)).to eq(:central) end - end - context '22-1995 STEM' do it 'should route to Eastern RPO' do form = education_benefits_claim.parsed_form form['isEdithNourseRogersScholarship'] = true education_benefits_claim.saved_claim.form = form.to_json - education_benefits_claim.saved_claim.form_id = '22-1995' + education_benefits_claim.saved_claim.form_id = '22-1995S' expect(described_class.region_for(education_benefits_claim)).to eq(:eastern) end it 'should route Philippines to Eastern RPO' do @@ -118,7 +116,26 @@ def school(data) } } education_benefits_claim.saved_claim.form = form.to_json - education_benefits_claim.saved_claim.form_id = '22-1995' + education_benefits_claim.saved_claim.form_id = '22-1995S' + expect(described_class.region_for(education_benefits_claim)).to eq(:eastern) + end + end + context '22-1995S' do + it 'should route to Eastern RPO' do + form = education_benefits_claim.parsed_form + education_benefits_claim.saved_claim.form = form.to_json + education_benefits_claim.saved_claim.form_id = '22-1995S' + expect(described_class.region_for(education_benefits_claim)).to eq(:eastern) + end + it 'should route Philippines to Eastern RPO' do + form = education_benefits_claim.parsed_form + form['newSchool'] = { + 'address' => { + 'country': 'PHL' + } + } + education_benefits_claim.saved_claim.form = form.to_json + education_benefits_claim.saved_claim.form_id = '22-1995S' expect(described_class.region_for(education_benefits_claim)).to eq(:eastern) end end diff --git a/spec/jobs/education_form/forms/va1995_spec.rb b/spec/jobs/education_form/forms/va1995_spec.rb index d55fc2e3642..62cfb2bf6d4 100644 --- a/spec/jobs/education_form/forms/va1995_spec.rb +++ b/spec/jobs/education_form/forms/va1995_spec.rb @@ -10,7 +10,7 @@ # For each sample application we have, format it and compare it against a 'known good' # copy of that submission. This technically covers all the helper logic found in the # `Form` specs, but are a good safety net for tracking how forms change over time. - %i[minimal kitchen_sink kitchen_sink_stem].each do |application_name| + %i[minimal kitchen_sink].each do |application_name| test_spool_file('1995', application_name) end diff --git a/spec/jobs/education_form/forms/va1995s_spec.rb b/spec/jobs/education_form/forms/va1995s_spec.rb new file mode 100644 index 00000000000..1fc1425590f --- /dev/null +++ b/spec/jobs/education_form/forms/va1995s_spec.rb @@ -0,0 +1,26 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe EducationForm::Forms::VA1995s do + let(:education_benefits_claim) { build(:va1995s).education_benefits_claim } + + subject { described_class.new(education_benefits_claim) } + + # For each sample application we have, format it and compare it against a 'known good' + # copy of that submission. This technically covers all the helper logic found in the + # `Form` specs, but are a good safety net for tracking how forms change over time. + %i[minimal kitchen_sink].each do |application_name| + test_spool_file('1995s', application_name) + end + + context '#direct_deposit_type' do + let(:education_benefits_claim) { create(:va1995s_full_form).education_benefits_claim } + it 'converts internal keys to text' do + expect(subject.school['name']).to eq('Test School Name') + expect(subject.form_type).to eq('CH33') + expect(subject.form_benefit).to eq('STEM') + expect(subject.header_form_type).to eq('STEM1995') + end + end +end diff --git a/spec/models/education_benefits_claim_spec.rb b/spec/models/education_benefits_claim_spec.rb index 633c1012278..7c912488102 100644 --- a/spec/models/education_benefits_claim_spec.rb +++ b/spec/models/education_benefits_claim_spec.rb @@ -7,7 +7,7 @@ create(:va1990).education_benefits_claim end - %w[1990 1995 1990e 5490 5495 1990n 0993 0994].each do |form_type| + %w[1990 1995 1990e 5490 5495 1990n 0993 0994 1995s].each do |form_type| method = "is_#{form_type}?" describe "##{method}" do @@ -121,6 +121,24 @@ def associated_submission end end + context 'with a form type of 1995s' do + subject do + create(:va1995s) + end + + it 'should create a submission' do + subject + + expect(associated_submission).to eq( + submission_attributes.merge( + 'form_type' => '1995s', + 'transfer_of_entitlement' => false, + 'chapter33' => true + ) + ) + end + end + context 'with a form type of 1990e' do subject do create(:va1990e) diff --git a/spec/models/education_benefits_submission_spec.rb b/spec/models/education_benefits_submission_spec.rb index 8a7be3f44b6..120a7952814 100644 --- a/spec/models/education_benefits_submission_spec.rb +++ b/spec/models/education_benefits_submission_spec.rb @@ -20,7 +20,7 @@ end it 'should validate form_type' do - %w[1995 1990 1990e 0993 0994].each do |form_type| + %w[1995 1990 1990e 0993 0994 1995s].each do |form_type| subject.form_type = form_type expect_attr_valid(subject, form_type) end diff --git a/spec/models/form_profile_spec.rb b/spec/models/form_profile_spec.rb index 0ca50dbee06..02e6ce56900 100644 --- a/spec/models/form_profile_spec.rb +++ b/spec/models/form_profile_spec.rb @@ -351,6 +351,27 @@ } end + let(:v22_1995_s_expected) do + { + 'veteranAddress' => { + 'street' => street_check[:street], + 'street2' => street_check[:street2], + 'city' => user.va_profile[:address][:city], + 'state' => user.va_profile[:address][:state], + 'country' => user.va_profile[:address][:country], + 'postal_code' => user.va_profile[:address][:postal_code][0..4] + }, + 'veteranFullName' => { + 'first' => user.first_name&.capitalize, + 'last' => user.last_name&.capitalize, + 'suffix' => user.va_profile[:suffix] + }, + 'homePhone' => us_phone, + 'veteranSocialSecurityNumber' => user.ssn, + 'email' => user.pciu_email + } + end + let(:v22_5490_expected) do { 'toursOfDuty' => [ @@ -753,6 +774,7 @@ def stub_methods_for_emis_data 22-1990N 22-1990E 22-1995 + 22-1995S 22-5490 22-5495 40-10007