-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Remove support for request accessible format form pilot
Now that there are no longer any departments taking part, remove code while we rethink.
- Loading branch information
Showing
3 changed files
with
4 additions
and
68 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,9 @@ | ||
module ContentItem | ||
module Attachments | ||
def attachment_details(attachment_id) | ||
found_attachment = content_item.dig("details", "attachments")&.find do |attachment| | ||
content_item.dig("details", "attachments")&.find do |attachment| | ||
attachment["id"] == attachment_id | ||
end | ||
|
||
return unless found_attachment | ||
|
||
found_attachment["attachment_id"] = found_attachment.delete("id") | ||
found_attachment["owning_document_content_id"] = content_item["content_id"] | ||
found_attachment | ||
end | ||
end | ||
end |
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -14,17 +14,9 @@ class ContentItemsAttachmentsTest < ActionView::TestCase | |
|
||
test "can render attachments using their metadata" do | ||
@content_item = PublicationPresenter.new( | ||
{ | ||
"content_id" => "doc_content_id", | ||
"details" => { | ||
"attachments" => [ | ||
{ "id" => "attachment_id", | ||
"title" => "Some title", | ||
"url" => "some/url", | ||
"alternative_format_contact_email" => "[email protected]" }, | ||
], | ||
}, | ||
}, | ||
{ "details" => { "attachments" => [{ "id" => "attachment_id", | ||
"title" => "Some title", | ||
"url" => "some/url" }] } }, | ||
"/publication", | ||
ApplicationController.new.view_context, | ||
) | ||
|
@@ -38,7 +30,6 @@ class ContentItemsAttachmentsTest < ActionView::TestCase | |
|
||
assert_includes rendered, "gem-c-attachment" | ||
assert_includes rendered, "Some title" | ||
assert_includes rendered, "href=\"/contact/govuk/request-accessible-format?content_id=doc_content_id&attachment_id=attachment_id" | ||
end | ||
|
||
test "it prioritises pre-rendered attachments" do | ||
|