Skip to content

Commit

Permalink
Display nursery urn on employment check
Browse files Browse the repository at this point in the history
  • Loading branch information
rjlynch committed Dec 30, 2024
1 parent 26932a1 commit 3e69384
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 3e69384

Please sign in to comment.