Skip to content

Commit

Permalink
Display the urn on the employment task
Browse files Browse the repository at this point in the history
Displays the urn as part of the nursery name on the admin employment
task view.
  • Loading branch information
rjlynch committed Dec 30, 2024
1 parent 2cd7f30 commit 88bab4e
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def initialize(claim)

def employment
[
["Current employment", claim.eligibility.eligible_ey_provider.nursery_name],
["Current employment", nursery_name],
["Start date", l(claim.eligibility.start_date)]
]
end
Expand Down Expand Up @@ -41,6 +41,19 @@ def student_loan_plan
["Student loan plan", claim.student_loan_plan&.humanize]
]
end

private

def eligible_ey_provider
claim.eligibility.eligible_ey_provider
end

def nursery_name
[
eligible_ey_provider.nursery_name,
"(#{eligible_ey_provider.urn})"
].join(" ")
end
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,20 @@
start_date: Date.new(2018, 1, 1)
})
}
let(:eligible_ey_provider) { create(:eligible_ey_provider) }
let(:eligible_ey_provider) do
create(
:eligible_ey_provider,
nursery_name: "Some Nursery",
urn: "EY123456"
)
end

subject { described_class.new(claim).employment }

it "shows current employment" do
expect(subject[0][1]).to eq claim.eligibility.eligible_ey_provider.nursery_name
expect(subject[0]).to eq(
["Current employment", "Some Nursery (EY123456)"]
)
end

it "shows start date" do
Expand Down

0 comments on commit 88bab4e

Please sign in to comment.