Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

4325 - Carrierwave deprecated 'extension_white_list' #4326

Merged
merged 3 commits into from
Sep 14, 2024

Conversation

WillNigel23
Copy link
Collaborator

No description provided.

@WillNigel23 WillNigel23 linked an issue Sep 10, 2024 that may be closed by this pull request
@@ -0,0 +1,5 @@
FactoryBot.define do
factory :document_upload do
file { Rack::Test::UploadedFile.new(File.open(File.join(Rails.root, 'test_data/uploads/test.pdf'))) }
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will allow us to create document_upload factory easier

expect(subject).not_to be_valid
expect(subject.errors.messages[:file]).to include(
"can't be blank",
'You are not allowed to upload "txt" files, allowed types: zip, pdf'
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This spec should catch (if by any chance carrierwave change their methods again) and validates that the file whitelisting works

@WillNigel23 WillNigel23 force-pushed the 4325-carrierwave-allowlist branch from bcda596 to d08ff3f Compare September 10, 2024 20:03
Copy link
Owner

@benwbrum benwbrum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks really good.

@benwbrum benwbrum merged commit c0bb63d into development Sep 14, 2024
3 checks passed
@benwbrum benwbrum deleted the 4325-carrierwave-allowlist branch September 14, 2024 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Carrierwave deprecated 'extension_white_list'
2 participants