Skip to content

Commit

Permalink
Chore: always show the user the eligibility index (#1201)
Browse files Browse the repository at this point in the history
  • Loading branch information
angela-tran committed Jan 13, 2023
2 parents 6197e64 + 079ae57 commit 1b4de6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
7 changes: 1 addition & 6 deletions benefits/eligibility/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,12 +74,7 @@ def index(request):
page.forms = [form]
response = TemplateResponse(request, TEMPLATE_INDEX, ctx)
else:
if agency.eligibility_verifiers.count() == 1:
verifier = agency.eligibility_verifiers.first()
session.update(request, verifier=verifier)
response = redirect(eligibility_start)
else:
response = TemplateResponse(request, TEMPLATE_INDEX, ctx)
response = TemplateResponse(request, TEMPLATE_INDEX, ctx)

return response

Expand Down
7 changes: 5 additions & 2 deletions tests/pytest/eligibility/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,11 @@ def test_index_get_agency_single_verifier(
path = reverse(ROUTE_INDEX)
response = client.get(path)

assert response.status_code == 302
assert response.url == reverse(ROUTE_START)
assert response.status_code == 200
assert response.template_name == TEMPLATE_INDEX
assert "page" in response.context_data
assert len(response.context_data["page"].forms) > 0
assert isinstance(response.context_data["page"].forms[0], EligibilityVerifierSelectionForm)


@pytest.mark.django_db
Expand Down

0 comments on commit 1b4de6f

Please sign in to comment.