-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Updates the admin eligibility presenter to include the rest of the eligibility details
- Loading branch information
Showing
4 changed files
with
123 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
57 changes: 52 additions & 5 deletions
57
...ls/policies/international_relocation_payments/eligibility_admin_answers_presenter_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,60 @@ | ||
require "rails_helper" | ||
|
||
RSpec.describe Policies::InternationalRelocationPayments::EligibilityAdminAnswersPresenter, type: :model do | ||
let(:claim) { build(:claim, :submittable, policy: Policies::InternationalRelocationPayments, academic_year: "2021/2022") } | ||
describe "#answers" do | ||
subject { described_class.new(eligibility).answers } | ||
|
||
subject(:presenter) { described_class.new(claim.eligibility) } | ||
let(:school) { create(:school) } | ||
|
||
describe "#answers" do | ||
it "returns an array of questions and answers for displaying to service operator" do | ||
expect(presenter.answers).to eq [[I18n.t("admin.current_school"), presenter.display_school(claim.eligibility.current_school)]] | ||
let(:eligibility) do | ||
build( | ||
:international_relocation_payments_eligibility, | ||
nationality: "American", | ||
passport_number: "123456789", | ||
current_school: school, | ||
subject: "physics", | ||
school_headteacher_name: "Principal Skinner", | ||
start_date: Date.new(2024, 3, 1), | ||
visa_type: "British National (Overseas) visa", | ||
date_of_entry: Date.new(2024, 2, 1) | ||
) | ||
end | ||
|
||
it do | ||
is_expected.to include( | ||
[ | ||
"Nationality", | ||
"American" | ||
], | ||
[ | ||
"Passport number", | ||
"123456789" | ||
], | ||
[ | ||
"Current school", | ||
/#{school.name}/ | ||
], | ||
[ | ||
"Subject", | ||
"Physics" | ||
], | ||
[ | ||
"School headteacher name", | ||
"Principal Skinner" | ||
], | ||
[ | ||
"Contract start date", | ||
"1 March 2024" | ||
], | ||
[ | ||
"Visa type", | ||
"British National (Overseas) visa" | ||
], | ||
[ | ||
"Date of entry", | ||
"1 February 2024" | ||
] | ||
) | ||
end | ||
end | ||
end |