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

Remove support for request accessible format form pilot #2470

Merged
merged 1 commit into from
Jun 24, 2022
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
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