Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Disability Benefits Team 1] Continue tracking startedFormVersion #20249

Draft
wants to merge 4 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def data_and_metadata_with_updated_rated_disabilities
end

def set_started_form_version(data)
if data['startedFormVersion'].blank?
if data['started_form_version'].blank? || data['startedFormVersion'].blank?
log_started_form_version(data, 'existing IPF missing startedFormVersion')
data['startedFormVersion'] = '2019'
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,8 +104,18 @@
end

context 'when toxic exposure' do
it 'returns startedFormVersion as 2019 in the response for toxic exposure 1.1 release' do

Check failure on line 107 in spec/requests/v0/disability_compensation_in_progress_forms_controller_spec.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

RSpec/RepeatedExample: Don't repeat examples within an example group.
VCR.use_cassette('lighthouse/veteran_verification/disability_rating/200_response') do
get v0_disability_compensation_in_progress_form_url(in_progress_form_lighthouse.form_id), params: nil
end

expect(response).to have_http_status(:ok)
json_response = JSON.parse(response.body)
expect(json_response['formData']['startedFormVersion']).to eq('2019')
end

# if the user with an IPF was not chosen for Toxic Exposure 1.1 release
it 'does return 2019 as startedFormVersion' do

Check failure on line 118 in spec/requests/v0/disability_compensation_in_progress_forms_controller_spec.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

RSpec/RepeatedExample: Don't repeat examples within an example group.
VCR.use_cassette('lighthouse/veteran_verification/disability_rating/200_response') do
get v0_disability_compensation_in_progress_form_url(in_progress_form_lighthouse.form_id), params: nil
end
Expand All @@ -125,7 +135,7 @@
let(:user) { loa1_user }
let!(:form_id) { '21-526EZ' }

it 'adds startedFormVersion when corresponding flag is enabled for user' do
it 'adds default startedFormVersion' do
get v0_disability_compensation_in_progress_form_url(form_id), params: nil
json_response = JSON.parse(response.body)
expect(json_response['formData']['startedFormVersion']).to eq('2022')
Expand Down Expand Up @@ -230,6 +240,42 @@
end
end

context 'when toxic exposure' do
it 'returns startedFormVersion as 2019 in the response for toxic exposure 1.1 release' do
VCR.use_cassette('evss/disability_compensation_form/rated_disabilities') do
get v0_disability_compensation_in_progress_form_url(in_progress_form.form_id), params: nil
end

expect(response).to have_http_status(:ok)
json_response = JSON.parse(response.body)
expect(json_response['formData']['startedFormVersion']).to eq('2019')
end

# if the user with an IPF was not chosen for Toxic Exposure 1.1 release
it 'does returns 2019 as startedFormVersion' do
VCR.use_cassette('lighthouse/veteran_verification/disability_rating/200_response') do
get v0_disability_compensation_in_progress_form_url(in_progress_form.form_id), params: nil
end

expect(response).to have_http_status(:ok)
json_response = JSON.parse(response.body)
expect(json_response['formData']['startedFormVersion']).to eq('2019')
end

it 'returns 2022 when existing IPF with 2022 as startedFormVersion' do
parsed_form_data = JSON.parse(in_progress_form.form_data)
parsed_form_data['startedFormVersion'] = '2022'
in_progress_form.form_data = parsed_form_data.to_json
in_progress_form.save!
VCR.use_cassette('lighthouse/veteran_verification/disability_rating/200_response') do
get v0_disability_compensation_in_progress_form_url(in_progress_form.form_id), params: nil
expect(response).to have_http_status(:ok)
json_response = JSON.parse(response.body)
expect(json_response['formData']['startedFormVersion']).to eq('2022')
end
end
end

describe '#index' do
subject do
get v0_disability_compensation_in_progress_forms_url, params: nil
Expand Down
Loading