Skip to content

Commit

Permalink
Remove support for request accessible format form pilot
Browse files Browse the repository at this point in the history
Now that there are no longer any departments taking part, remove code 
while we rethink.
  • Loading branch information
KludgeKML committed Jun 23, 2022
1 parent e96cf36 commit 4a82a7e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 68 deletions.
8 changes: 1 addition & 7 deletions app/presenters/content_item/attachments.rb
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
49 changes: 0 additions & 49 deletions test/presenters/content_item/attachments_test.rb

This file was deleted.

15 changes: 3 additions & 12 deletions test/views/content_items/attachments.html.erb_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
Expand All @@ -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&amp;attachment_id=attachment_id"
end

test "it prioritises pre-rendered attachments" do
Expand Down

0 comments on commit 4a82a7e

Please sign in to comment.