diff --git a/app/views/partners/_documents.html.erb b/app/views/partners/_documents.html.erb
index 23b832e65e..c14894e6d2 100644
--- a/app/views/partners/_documents.html.erb
+++ b/app/views/partners/_documents.html.erb
@@ -2,25 +2,17 @@
-
-
-
-
-
- | Filename |
- |
-
-
-
- <% partner.documents.each do |document| %>
-
- | <%= link_to document.filename, rails_blob_path(document, disposition: "attachment") %> |
- <%= delete_button_to attachment_path(document), { size: "md", confirm: "Are you sure you want to permanently remove this document?" } %>
- |
- <% end %>
-
-
-
+
+
+ <% partner.documents.each do |doc| %>
+ <% if doc.persisted? %>
+ -
+ <%= link_to doc.blob.filename.to_s, rails_blob_path(doc), class: "font-weight-bold w-75 text-truncate" %>
+ <%= delete_button_to attachment_path(doc), { text: "Remove", size: "md", confirm: "Are you sure you want to permanently remove this document?" } %>
+
+ <% end %>
+ <% end %>
+
diff --git a/spec/system/partner_system_spec.rb b/spec/system/partner_system_spec.rb
index 4736fc044c..e8e143d3f1 100644
--- a/spec/system/partner_system_spec.rb
+++ b/spec/system/partner_system_spec.rb
@@ -378,6 +378,31 @@
partner.reload
expect(partner.send_reminders).to be false
end
+
+ it "allows documents to be uploaded" do
+ document_1 = Rails.root.join("spec/fixtures/files/distribution_program_address.pdf")
+ document_2 = Rails.root.join("spec/fixtures/files/distribution_same_address.pdf")
+ documents = [document_1, document_2]
+
+ # Upload the documents
+ visit subject
+ attach_file(documents, make_visible: true) do
+ page.find('input#partner_documents').click
+ end
+
+ # Save Progress
+ click_button "Update Partner"
+
+ # Expect documents to exist on show partner page
+ expect(page).to have_current_path(partner_path(partner.id))
+ expect(page).to have_link("distribution_program_address.pdf")
+ expect(page).to have_link("distribution_same_address.pdf")
+
+ # Expect documents to exist on edit partner page
+ visit subject
+ expect(page).to have_link("distribution_program_address.pdf")
+ expect(page).to have_link("distribution_same_address.pdf")
+ end
end
describe "#edit_profile" do