diff --git a/app/components/admin/poll/questions/answers/documents/index_component.html.erb b/app/components/admin/poll/questions/answers/documents/index_component.html.erb
index 6db626293..b23f46ef2 100644
--- a/app/components/admin/poll/questions/answers/documents/index_component.html.erb
+++ b/app/components/admin/poll/questions/answers/documents/index_component.html.erb
@@ -36,7 +36,7 @@
<% documents.each do |document| %>
|
- <%= link_to document.title, document.attachment %>
+ <%= document.title %>
|
<%= render Admin::Poll::Questions::Answers::Documents::TableActionsComponent.new(document) %>
diff --git a/spec/system/admin/poll/questions/answers/documents/documents_spec.rb b/spec/system/admin/poll/questions/answers/documents/documents_spec.rb
index cc6f55bc9..9a65fc182 100644
--- a/spec/system/admin/poll/questions/answers/documents/documents_spec.rb
+++ b/spec/system/admin/poll/questions/answers/documents/documents_spec.rb
@@ -30,11 +30,16 @@ describe "Documents", :admin do
visit admin_answer_documents_path(answer)
+ expect(page).not_to have_link "Download file"
+
documentable_attach_new_file(Rails.root.join("spec/fixtures/files/clippy.pdf"))
click_button "Save"
expect(page).to have_content "Document uploaded successfully"
- expect(page).to have_link "clippy.pdf"
+
+ within("tr", text: "clippy.pdf") do
+ expect(page).to have_link "Download file"
+ end
end
scenario "with invalid data" do
|