Skip to content

Commit

Permalink
[Automated] Merged master into target k8s
Browse files Browse the repository at this point in the history
  • Loading branch information
va-vsp-bot authored Apr 10, 2024
2 parents 9302cd6 + 7395eaf commit 1e60dd7
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 187 deletions.
2 changes: 0 additions & 2 deletions .github/CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,6 @@ app/models/form1010cg/submission.rb @department-of-veterans-affairs/vfs-10-10 @d
app/models/form1095_b.rb @department-of-veterans-affairs/vfs-1095-b @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/models/form526_job_status.rb @department-of-veterans-affairs/Disability-Experience @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/models/form526_submission.rb @department-of-veterans-affairs/Disability-Experience @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/models/form5655_submission.rb @department-of-veterans-affairs/vsa-debt-resolution @department-of-veterans-affairs/backend-review-group
app/models/form_attachment.rb @department-of-veterans-affairs/Benefits-Team-1 @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/models/form_profile.rb @department-of-veterans-affairs/vfs-authenticated-experience-backend @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
app/models/form_profiles @department-of-veterans-affairs/my-education-benefits @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
Expand Down Expand Up @@ -1427,7 +1426,6 @@ spec/models/form1010cg @department-of-veterans-affairs/vfs-10-10 @department-of-
spec/models/form1095_b_spec.rb @department-of-veterans-affairs/vfs-1095-b @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/models/form526_job_status_spec.rb @department-of-veterans-affairs/Disability-Experience @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/models/form526_submission_spec.rb @department-of-veterans-affairs/Disability-Experience @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/models/form5655_submission_spec.rb @department-of-veterans-affairs/vsa-debt-resolution @department-of-veterans-affairs/backend-review-group
spec/models/form_attachment_spec.rb @department-of-veterans-affairs/vfs-authenticated-experience-backend @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/models/form_profile_spec.rb @department-of-veterans-affairs/vfs-authenticated-experience-backend @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
spec/models/form_submission_spec.rb @department-of-veterans-affairs/platform-va-product-forms @department-of-veterans-affairs/Disability-Experience @department-of-veterans-affairs/va-api-engineers @department-of-veterans-affairs/backend-review-group
Expand Down
62 changes: 0 additions & 62 deletions app/models/form5655_submission.rb

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class StaleUserError < StandardError; end

def kms_encryption_context
{
model_name: Form5655Submission.model_name.to_s,
model_name: 'Form5655Submission',
model_id: id
}
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,9 @@ def mock_pdf_fill
service = described_class.new(user)
builder = DebtsApi::V0::FsrFormBuilder.new(vha_form_data, '', user)
copay_count = builder.vha_forms.length
expect { service.submit_combined_fsr(builder) }.to change(Form5655Submission, :count).by(copay_count)
expect { service.submit_combined_fsr(builder) }.to change(
DebtsApi::V0::Form5655Submission, :count
).by(copay_count)
expect(DebtsApi::V0::Form5655Submission.last.in_progress?).to eq(true)
form = service.send(:add_vha_specific_data, DebtsApi::V0::Form5655Submission.last)
expect(form.class).to be(Hash)
Expand All @@ -280,7 +282,9 @@ def mock_pdf_fill
copay_count = builder.vha_forms.length
debt_count = builder.vba_form.present? ? 1 : 0
needed_count = copay_count + debt_count
expect { service.submit_combined_fsr(builder) }.to change(Form5655Submission, :count).by(needed_count)
expect do
service.submit_combined_fsr(builder)
end.to change(DebtsApi::V0::Form5655Submission, :count).by(needed_count)
expect(DebtsApi::V0::Form5655Submission.last.public_metadata['combined']).to eq(true)
debt_amounts = DebtsApi::V0::Form5655Submission.with_debt_type('DEBT').last.public_metadata['debt_amounts']
expect(debt_amounts).to eq(['541.67', '1134.22'])
Expand All @@ -300,13 +304,13 @@ def mock_pdf_fill
it 'persists vba FSRs' do
service = described_class.new(user)
builder = DebtsApi::V0::FsrFormBuilder.new(valid_vba_form_data, '', user)
expect { service.create_vba_fsr(builder) }.to change(Form5655Submission, :count).by(1)
expect { service.create_vba_fsr(builder) }.to change(DebtsApi::V0::Form5655Submission, :count).by(1)
end

it 'gracefully handles a lack of vba FSRs' do
service = described_class.new(user)
builder = DebtsApi::V0::FsrFormBuilder.new(valid_vha_form_data, '', user)
expect { service.create_vba_fsr(builder) }.not_to change(Form5655Submission, :count)
expect { service.create_vba_fsr(builder) }.not_to change(DebtsApi::V0::Form5655Submission, :count)
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,41 +3,39 @@
require 'rails_helper'

RSpec.describe DebtsApi::V0::Form5655Submission do
describe 'namespace portability' do
let!(:some_record) do
create(:form5655_submission, public_metadata: { 'streamlined' => { 'type' => 'short', 'value' => true } })
end

it 'shares data with the old model scope' do
expect(described_class.last.form).to eq(some_record.form)
expect(Form5655Submission.last.form).to eq(some_record.form)
end
end

describe 'scopes' do
let!(:first_record) do
create(:form5655_submission, public_metadata: { 'streamlined' => { 'type' => 'short', 'value' => true } })
create(
:debts_api_form5655_submission,
public_metadata: { 'streamlined' => { 'type' => 'short', 'value' => true } }
)
end
let!(:second_record) do
create(:form5655_submission, public_metadata: { 'streamlined' => { 'type' => 'short', 'value' => false } })
create(
:debts_api_form5655_submission,
public_metadata: { 'streamlined' => { 'type' => 'short', 'value' => false } }
)
end
let!(:third_record) { create(:form5655_submission, public_metadata: {}) }
let!(:third_record) { create(:debts_api_form5655_submission, public_metadata: {}) }
let!(:fourth_record) do
create(:form5655_submission, public_metadata: { 'streamlined' => { 'type' => 'short', 'value' => nil } })
create(
:debts_api_form5655_submission,
public_metadata: { 'streamlined' => { 'type' => 'short', 'value' => nil } }
)
end

it 'includes records within scope' do
expect(Form5655Submission.streamlined).to include(first_record)
expect(Form5655Submission.streamlined.length).to eq(1)
expect(DebtsApi::V0::Form5655Submission.streamlined).to include(first_record)
expect(DebtsApi::V0::Form5655Submission.streamlined.length).to eq(1)

expect(Form5655Submission.not_streamlined).to include(second_record)
expect(Form5655Submission.not_streamlined.length).to eq(1)
expect(DebtsApi::V0::Form5655Submission.not_streamlined).to include(second_record)
expect(DebtsApi::V0::Form5655Submission.not_streamlined.length).to eq(1)

expect(Form5655Submission.streamlined_unclear).to include(third_record)
expect(Form5655Submission.streamlined_unclear.length).to eq(1)
expect(DebtsApi::V0::Form5655Submission.streamlined_unclear).to include(third_record)
expect(DebtsApi::V0::Form5655Submission.streamlined_unclear.length).to eq(1)

expect(Form5655Submission.streamlined_nil).to include(fourth_record)
expect(Form5655Submission.streamlined_nil.length).to eq(1)
expect(DebtsApi::V0::Form5655Submission.streamlined_nil).to include(fourth_record)
expect(DebtsApi::V0::Form5655Submission.streamlined_nil.length).to eq(1)
end
end

Expand Down Expand Up @@ -65,7 +63,7 @@
end

describe '.user_cache_id' do
let(:form5655_submission) { create(:form5655_submission) }
let(:form5655_submission) { create(:debts_api_form5655_submission) }
let(:user) { build(:user, :loa3) }

it 'creates a new User profile attribute' do
Expand All @@ -81,7 +79,7 @@
end

it 'returns an error' do
expect { form5655_submission.user_cache_id }.to raise_error(Form5655Submission::StaleUserError)
expect { form5655_submission.user_cache_id }.to raise_error(DebtsApi::V0::Form5655Submission::StaleUserError)
end
end
end
Expand Down
9 changes: 8 additions & 1 deletion spec/lib/debt_management_center/sharepoint/request_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@

describe '#upload' do
let(:form_content) { { 'foo' => 'bar' } }
let(:form_submission) { create(:form5655_submission) }
let(:form_submission) { create(:debts_api_form5655_submission) }
let(:station_id) { '123' }
let(:file_path) { ::Rails.root.join(*'/spec/fixtures/dmc/5655.pdf'.split('/')).to_s }
let(:body) do
Expand All @@ -87,6 +87,13 @@
allow(PdfFill::Filler).to receive(:fill_ancillary_form).and_return(file_path)
allow(File).to receive(:delete).and_return(nil)
allow(DateTime).to receive(:now).and_return(upload_time)
allow_any_instance_of(subject.class).to receive(:set_user_data).and_return(
{
ssn: '123456598',
first_name: 'xxx',
last_name: 'Beer'
}
)
end

it 'uploads a pdf file to SharePoint' do
Expand Down
92 changes: 0 additions & 92 deletions spec/models/form5655_submission_spec.rb

This file was deleted.

0 comments on commit 1e60dd7

Please sign in to comment.