Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1782] Help us CTA from delivery error message #8000

Merged
merged 1 commit into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions app/helpers/info_request_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -185,10 +185,14 @@ def status_text_internal_review(info_request, _opts = {})
public_body_link: public_body_link(info_request.public_body))
end

def status_text_error_message(_info_request, _opts = {})
def status_text_error_message(info_request, _opts = {})
body = info_request.public_body
_('There was a <strong>delivery error</strong> or similar, which ' \
'needs fixing by the {{site_name}} team.',
site_name: site_name)
'needs fixing by the {{site_name}} team. Can you help by ' \
'<a href="{{change_request_url}}">finding updated contact ' \
'details</a>?',
site_name: site_name,
change_request_url: new_change_request_body_path(body: body.url_name))
end

def status_text_requires_admin(_info_request, _opts = {})
Expand Down
2 changes: 2 additions & 0 deletions doc/CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

## Highlighted Features

* Signpost users to find new contact details for requests with delivery errors
(Gareth Rees)
* Add admin view of unmasked version of main body part attachments (Gareth Rees)
* Add internal ID number to authority CSV download (Alex Parsons, Graeme
Porteous)
Expand Down
12 changes: 10 additions & 2 deletions spec/helpers/info_request_helper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -359,9 +359,17 @@
context 'error_message' do

it 'returns a description' do
allow(info_request).to receive(:calculate_status).and_return("error_message")
allow(info_request).
to receive(:public_body).and_return(double(url_name: 'foo'))

allow(info_request).
to receive(:calculate_status).and_return('error_message')

expected = 'There was a <strong>delivery error</strong> or similar, ' \
'which needs fixing by the Alaveteli team.'
'which needs fixing by the Alaveteli team. Can you help ' \
'by <a href="/change_request/new/foo">finding updated ' \
'contact details</a>?'

expect(status_text(info_request)).to eq(expected)
end

Expand Down
Loading