Skip to content

Commit a9cb079

Browse files
committed
Include school name for work history contact FI's in the main heading
1 parent f6d8364 commit a9cb079

File tree

4 files changed

+25
-13
lines changed

4 files changed

+25
-13
lines changed

app/view_objects/assessor_interface/further_information_request_view_object.rb

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,7 @@ def review_items(items)
6767
recieved_date: further_information_request.received_at.to_date.to_fs,
6868
requested_date:
6969
further_information_request.requested_at.to_date.to_fs,
70-
heading:
71-
I18n.t(
72-
item.failure_reason_key,
73-
scope: %i[
74-
assessor_interface
75-
assessment_sections
76-
failure_reasons
77-
as_statement
78-
],
79-
),
70+
heading: heading(item),
8071
assessor_request: item.failure_reason_assessor_feedback,
8172
applicant_text_response: item.response,
8273
applicant_contact_response: work_history_contact_response(item),
@@ -117,4 +108,23 @@ def work_history_contact_response(item)
117108
},
118109
}.map { |_key, value| "#{value[:title]}: #{value[:value]}" }
119110
end
111+
112+
def heading(item)
113+
content =
114+
I18n.t(
115+
item.failure_reason_key,
116+
scope: %i[
117+
assessor_interface
118+
assessment_sections
119+
failure_reasons
120+
as_statement
121+
],
122+
)
123+
124+
if item.work_history_contact?
125+
content.gsub(".", " for #{item.work_history.school_name}.")
126+
else
127+
content
128+
end
129+
end
120130
end

spec/factories/further_information_request_items.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@
6060
failure_reason_key { "unrecognised_references" }
6161
work_history do
6262
further_information_request.application_form.work_histories.first ||
63-
create(:work_history, application_form:)
63+
create(:work_history, :completed, application_form:)
6464
end
6565
end
6666

spec/system/assessor_interface/reviewing_further_information_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,8 @@ def and_i_see_the_fi_responses
123123
"Subjects entered are acceptable for QTS, but the uploaded qualifications do not match them.",
124124
)
125125
expect(items.last).to have_content(
126-
"We could not verify 1 or more references entered by the applicant.",
126+
"We could not verify 1 or more references entered by the applicant for " \
127+
"#{application_form.work_histories.first.school_name}.",
127128
)
128129
end
129130

spec/view_objects/assessor_interface/further_information_request_view_object_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,8 @@
181181
requested_date:
182182
further_information_request.requested_at.to_date.to_fs,
183183
heading:
184-
"We could not verify 1 or more references entered by the applicant.",
184+
"We could not verify 1 or more references entered by the applicant" \
185+
" for #{work_history_contact_item.work_history.school_name}.",
185186
assessor_request:
186187
work_history_contact_item.failure_reason_assessor_feedback,
187188
applicant_contact_response: [

0 commit comments

Comments
 (0)