-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
72987 persist ipf data in 5655 (#16019)
* save InProgressForm to 5655Submission * oh linter, what would I do with out you? * remove schema anomolies
- Loading branch information
Showing
7 changed files
with
112 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
modules/debts_api/spec/lib/debt_api/v0/vba_fsr_form_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
require 'debts_api/v0/fsr_form_builder' | ||
require 'debts_api/v0/vha_fsr_form' | ||
RSpec.describe DebtsApi::V0::VbaFsrForm, type: :service do | ||
describe '#persist_form_submission' do | ||
let(:combined_form_data) { get_fixture_absolute('modules/debts_api/spec/fixtures/fsr_forms/combined_fsr_form') } | ||
let(:vba_form_data) { get_fixture_absolute('modules/debts_api/spec/fixtures/fsr_forms/vba_fsr_form') } | ||
let(:vha_form_data) { get_fixture_absolute('modules/debts_api/spec/fixtures/fsr_forms/vha_fsr_form') } | ||
let(:user) { build(:user, :loa3) } | ||
let(:user_data) { build(:user_profile_attributes) } | ||
|
||
context 'given an InProgressForm can be found' do | ||
let(:builder) { DebtsApi::V0::FsrFormBuilder.new(combined_form_data, '123', user) } | ||
let(:in_progress_form) { create(:in_progress_5655_form, user_uuid: user.uuid) } | ||
|
||
it 'saves ipf data' do | ||
in_progress_form | ||
vba_form = builder.vba_form | ||
submission = vba_form.persist_form_submission | ||
expect(submission.ipf_data).to eq(in_progress_form.form_data) | ||
end | ||
end | ||
|
||
context 'given an InProgressForm can not be found' do | ||
let(:builder) { DebtsApi::V0::FsrFormBuilder.new(combined_form_data, '123', user) } | ||
|
||
it 'leaves ipf data nil' do | ||
vha_form = builder.vha_forms.first | ||
submission = vha_form.persist_form_submission | ||
expect(submission.ipf_data).to eq(nil) | ||
end | ||
end | ||
end | ||
end |
36 changes: 36 additions & 0 deletions
36
modules/debts_api/spec/lib/debt_api/v0/vha_fsr_form_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
require 'debts_api/v0/fsr_form_builder' | ||
require 'debts_api/v0/vha_fsr_form' | ||
RSpec.describe DebtsApi::V0::VhaFsrForm, type: :service do | ||
describe '#persist_form_submission' do | ||
let(:combined_form_data) { get_fixture_absolute('modules/debts_api/spec/fixtures/fsr_forms/combined_fsr_form') } | ||
let(:vba_form_data) { get_fixture_absolute('modules/debts_api/spec/fixtures/fsr_forms/vba_fsr_form') } | ||
let(:vha_form_data) { get_fixture_absolute('modules/debts_api/spec/fixtures/fsr_forms/vha_fsr_form') } | ||
let(:user) { build(:user, :loa3) } | ||
let(:user_data) { build(:user_profile_attributes) } | ||
|
||
context 'given an InProgressForm can be found' do | ||
let(:builder) { DebtsApi::V0::FsrFormBuilder.new(combined_form_data, '123', user) } | ||
let(:in_progress_form) { create(:in_progress_5655_form, user_uuid: user.uuid) } | ||
|
||
it 'saves ipf data' do | ||
in_progress_form | ||
vha_form = builder.vha_forms.first | ||
submission = vha_form.persist_form_submission | ||
expect(submission.ipf_data).to eq(in_progress_form.form_data) | ||
end | ||
end | ||
|
||
context 'given an InProgressForm can not be found' do | ||
let(:builder) { DebtsApi::V0::FsrFormBuilder.new(combined_form_data, '123', user) } | ||
|
||
it 'leaves ipf data nil' do | ||
vha_form = builder.vha_forms.first | ||
submission = vha_form.persist_form_submission | ||
expect(submission.ipf_data).to eq(nil) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters