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:
@@ -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) %>
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user