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

[#2957] Add .webp to casa org logo accepted extensions #3044

Merged

Conversation

rhian-cs
Copy link
Contributor

What github issue is this PR for, if any?

Resolves #2957

What changed, and why?

In the organization edit page (/casa_org/1/edit), the admin can now add a .webp logo.

How will this affect user permissions?

No permissions will be affected.

How is this tested? (please write tests!) 💖💪

  • Added a test to check if attaching an image for the logo worked fine

Unfortunately, I can't add a test to check if different extensions work. When using the page.attach_file method any file will work, since the accept: ".png,.gif,.jpg,.jpeg,.webp" only tells the browser which files to show in the file selection menu.

We could also validate the file format (extension or MIME type) in the backend, if it is of any interest. It would also be easier to test.

Screenshots please :)

When clicking the Logo "Choose File" button:
image

Before: .webp files did not show up in the "Open file" window
image

After: .webp files now show up in the window
image

@github-actions github-actions bot added erb ruby Pull requests that update Ruby code Tests! 🎉💖👏 labels Dec 22, 2021
Co-authored-by: Mauricio Lima <mauricio.prl42@gmail.com>
@compwron compwron merged commit 226ae0f into rubyforgood:main Dec 23, 2021
@rhian-cs rhian-cs deleted the 2957-add-webp-to-acceptable-casa-org-logos branch December 23, 2021 12:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
erb ruby Pull requests that update Ruby code Tests! 🎉💖👏
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add .webp to Acceptable Logo File Types
3 participants