Skip to content
Merged
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 @@ -30,7 +30,7 @@ def restricted_list_of_forms

def restricted_benefits_intake_forms
%w[20-10206 20-10207 21-0845 21-0972 21-10210 21-4142 21-4140 21-4142a 21-4502 21-8940V1 21P-0847 21P-527EZ
21P-530EZ 21P-0969 21P-535 21-2680 21-0779 21-4192 21P-530a] + uploadable_forms
21P-530EZ 21P-0969 21P-535 21-2680 21-0779 21-4192 21P-530a 21-4138] + uploadable_forms
end
Comment thread
dominicpadula1 marked this conversation as resolved.

def decision_reviews_forms_if_enabled
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@
it 'includes multi-party form IDs in the restricted benefits intake forms' do
forms = controller.send(:restricted_benefits_intake_forms)

expect(forms).to include('21-2680', '21-0779', '21-4192', '21P-530a')
expect(forms).to include('21-2680', '21-0779', '21-4192', '21P-530a', '21-4138')
end
end

Expand Down
10 changes: 10 additions & 0 deletions spec/factories/form_submissions.rb
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,16 @@
end
end

trait :with_form214138 do
user_account_id { '' }
form_type { '21-4138' }
updated_at { 1.day.ago }
created_at { 2.days.ago }
form_submission_attempts do
create_list(:form_submission_attempt, 1, benefits_intake_uuid: 'c7e1f2a3-b4d5-4e6f-9a0b-1c2d3e4f5a6b')
end
end

trait :with_form_blocked do
user_account_id { '' }
form_type { 'NOT-WHITELISTED' }
Expand Down
44 changes: 43 additions & 1 deletion spec/lib/forms/submission_statuses/report_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
subject { described_class.new(user_account:, allowed_forms:) }

let(:user_account) { create(:user_account) }
let(:allowed_forms) { %w[20-10207 21-0845 21-0972 21-10210 21-4142 21-4142a 21P-0847 21-4140 21P-530EZ] }
let(:allowed_forms) { %w[20-10207 21-0845 21-0972 21-10210 21-4138 21-4142 21-4142a 21P-0847 21-4140 21P-530EZ] }
let(:benefits_intake_service) { instance_double(BenefitsIntake::Service) }
let(:benefits_intake_gateway) { Forms::SubmissionStatuses::Gateways::BenefitsIntakeGateway }

Expand Down Expand Up @@ -293,6 +293,48 @@
end
end

context 'when user has a 21-4138 submission' do
before do
create(:form_submission, :with_form214138, user_account_id: user_account.id)

allow_any_instance_of(benefits_intake_gateway).to receive(:lighthouse_submissions).and_return([])
allow(BenefitsIntake::Service).to receive(:new).and_return(benefits_intake_service)
allow(benefits_intake_service).to receive(:bulk_status).and_return(
double(body: {
'data' => [
{
'id' => 'c7e1f2a3-b4d5-4e6f-9a0b-1c2d3e4f5a6b',
'attributes' => {
'detail' => 'detail',
'guid' => 'c7e1f2a3-b4d5-4e6f-9a0b-1c2d3e4f5a6b',
'message' => 'message',
'status' => 'received',
'updated_at' => 1.day.ago
}
}
]
})
)
end

it 'includes the 21-4138 submission in the results' do
result = subject.run

form_types = result.submission_statuses.map(&:form_type)
expect(form_types).to include('21-4138')
end

it 'returns the correct values for a 21-4138 submission' do
result = subject.run

submission_status = result.submission_statuses.find { |s| s.form_type == '21-4138' }
expect(submission_status).not_to be_nil
expect(submission_status.id).to eq('c7e1f2a3-b4d5-4e6f-9a0b-1c2d3e4f5a6b')
expect(submission_status.status).to eq('received')
expect(submission_status.pdf_support).to be(true)
end
end

context 'logging errors' do
let(:logger) { Rails.logger }

Expand Down
Loading