Skip to content

Commit

Permalink
Make long title test a little less cryptic
Browse files Browse the repository at this point in the history
It's a little confusing have a string multiplication inside an
interpolation.
  • Loading branch information
kevindew committed Apr 26, 2021
1 parent d2f4ed9 commit 0dfe2e9
Showing 1 changed file with 5 additions and 1 deletion.
Expand Up @@ -52,9 +52,13 @@
end

context "when the file attachment does not satisfy requirements" do
let(:too_long_title) { "#{'A' * Requirements::Form::FileAttachmentUploadChecker::TITLE_MAX_LENGTH}A" }
let(:whitehall_file_attachment) { build(:whitehall_export_file_attachment, title: too_long_title) }

let(:too_long_title) do
length = Requirements::Form::FileAttachmentUploadChecker::TITLE_MAX_LENGTH + 1
SecureRandom.alphanumeric(length)
end

let(:error_message) do
I18n.t!("requirements.title.too_long.form_message",
max_length: Requirements::Form::FileAttachmentUploadChecker::TITLE_MAX_LENGTH)
Expand Down

0 comments on commit 0dfe2e9

Please sign in to comment.