Remove redundant link to download document

There's a link next to it that does the exact same thing and includes
the word "download", which was confusing in some cases since people
might think that links with different texts lead to different pages.
This commit is contained in:
Javi Martín
2023-10-12 16:26:44 +02:00
parent 1826e3b691
commit bdb92e4161
2 changed files with 7 additions and 2 deletions

View File

@@ -36,7 +36,7 @@
<% documents.each do |document| %> <% documents.each do |document| %>
<tr> <tr>
<td> <td>
<%= link_to document.title, document.attachment %> <%= document.title %>
</td> </td>
<td> <td>
<%= render Admin::Poll::Questions::Answers::Documents::TableActionsComponent.new(document) %> <%= render Admin::Poll::Questions::Answers::Documents::TableActionsComponent.new(document) %>

View File

@@ -30,11 +30,16 @@ describe "Documents", :admin do
visit admin_answer_documents_path(answer) 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")) documentable_attach_new_file(Rails.root.join("spec/fixtures/files/clippy.pdf"))
click_button "Save" click_button "Save"
expect(page).to have_content "Document uploaded successfully" 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 end
scenario "with invalid data" do scenario "with invalid data" do