Skip to content

Commit

Permalink
Merge pull request #3373 from DFE-Digital/CAPT-1896/cant-complete-pay…
Browse files Browse the repository at this point in the history
…roll-gender-admin-task

Keep task if claim updated with gender
  • Loading branch information
rjlynch authored Nov 7, 2024
2 parents 0eff722 + 759e2b7 commit 641cdc7
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def applicable_task_names
tasks << "student_loan_plan" if claim.submitted_without_slc_data?
tasks << "payroll_details" if claim.must_manually_validate_bank_details?
tasks << "matching_details" if matching_claims.exists?
tasks << "payroll_gender" if claim.payroll_gender_missing?
tasks << "payroll_gender" if claim.payroll_gender_missing? || claim.tasks.exists?(name: "payroll_gender")

tasks
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def applicable_task_names
tasks << "teaching_hours"
tasks << "payroll_details" if claim.must_manually_validate_bank_details?
tasks << "matching_details" if matching_claims.exists?
tasks << "payroll_gender" if claim.payroll_gender_missing?
tasks << "payroll_gender" if claim.payroll_gender_missing? || claim.tasks.exists?(name: "payroll_gender")

tasks
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,40 @@
expect(claim.latest_decision).to be_approved
expect(claim.latest_decision.created_by).to eq(@signed_in_user)
end

scenario "with a policy where payroll gender is the last task" do
irp_claim = create(
:claim,
:submitted,
policy: Policies::InternationalRelocationPayments,
payroll_gender: :dont_know
)

fe_claim = create(
:claim,
:submitted,
policy: Policies::FurtherEducationPayments,
payroll_gender: :dont_know
)

visit admin_claim_tasks_path(irp_claim)

click_on "How is the claimant’s gender recorded for payroll purposes?"

choose "Male"

click_on "Save and continue"

expect(page).to have_content("Claim decision")

visit admin_claim_tasks_path(fe_claim)

click_on "How is the claimant’s gender recorded for payroll purposes?"

choose "Male"

click_on "Save and continue"

expect(page).to have_content("Claim decision")
end
end

0 comments on commit 641cdc7

Please sign in to comment.