Skip to content

Commit

Permalink
Merge pull request #995 from DFE-Digital/upload-40
Browse files Browse the repository at this point in the history
increase upload threshold to 40 files
  • Loading branch information
asmega authored Jan 25, 2024
2 parents 7b94417 + b9069dd commit bbff918
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion app/validators/file_upload_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class FileUploadValidator < ActiveModel::EachValidator
include FileSizeHelper

MAX_FILE_SIZE = 100.megabytes
MAX_FILES = 20
MAX_FILES = 40

CONTENT_TYPES = {
".apng" => "image/apng",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<% content_for :back_link_url, back_link_url %>

<div class="govuk-grid-row">
<div class="govuk-grid-column-two-thirds-from-desktop ">
<div class="govuk-grid-column-two-thirds-from-desktop">
<%= form_with model: form, url: form_path, method: :patch do |f| %>
<%= f.govuk_error_summary %>

Expand Down Expand Up @@ -34,7 +34,7 @@
:evidence_uploads,
multiple: true,
label: { text: "Upload files", size: "m" },
hint: { text: "You can upload up to 20 files. Each file must be smaller than #{max_allowed_file_size}. Larger files may take longer to upload. We will let you know when it is done." }
hint: { text: "You can upload up to #{FileUploadValidator::MAX_FILES} files. Each file must be smaller than #{max_allowed_file_size}. Larger files may take longer to upload. We will let you know when it is done." }
) %>

<%= f.govuk_submit "Save and continue" %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
:evidence_uploads,
multiple: true,
label: { text: "Upload files", size: "m" },
hint: { text: "Must be smaller than #{max_allowed_file_size}" }
hint: { text: "You can upload up to #{FileUploadValidator::MAX_FILES} files. Each file must be smaller than #{max_allowed_file_size}. Larger files may take longer to upload. We will let you know when it is done." }
) %>

<%= f.govuk_submit "Save and continue" %>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@
fixture_file_upload("upload.txt")
end
expect(upload_form.save).to be false
expect(upload_form.errors[:evidence_uploads]).to eq(["You can only upload 20 files"])
expect(upload_form.errors[:evidence_uploads]).to eq(["You can only upload 40 files"])
end
end
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,7 @@ def then_cannot_add_more_evidence
def then_i_see_a_list_of_max_uploaded_files
expect(page).to have_content("Uploaded evidence")
within(".govuk-summary-list") do
expect(page).to have_link("upload1.pdf", count: 20, href: /active_storage/)
expect(page).to have_link("upload1.pdf", count: 40, href: /active_storage/)
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ def when_i_upload_the_maximum_number_of_files
def then_i_see_a_list_of_max_uploaded_files
expect(page).to have_content("Uploaded evidence")
within(".govuk-summary-list") do
expect(page).to have_link("upload1.pdf", count: 20, href: /active_storage/)
expect(page).to have_link("upload1.pdf", count: 40, href: /active_storage/)
end
end

Expand Down

0 comments on commit bbff918

Please sign in to comment.