fix: delete boilerplate favicon on login page #6146
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Previously, network tools show a 404 getting /users/assets/images/favicon.svg on /users/sign_in, and some tests intermittently failed with this 404. Delete the extraneous favicon link from devise boilerplate to let the normal favicon work on the login screen.
Fixes test flake at
https://github.com/rubyforgood/casa/wiki/Flaky-tests#suspected-testing-tool-crash
What github issue is this PR for, if any?
Resolves flaky test at . The test reports sometimes failing with
No route matches [GET] "/users/assets/images/favicon.svg"
.What changed, and why?
The devise-generated view at
app/views/layouts/devise.html.erb
had its own favicon, which would make 404s on the page, and these 404s would fail some tests. Deleting this link tag lets the normal favicon present on other pages work.Note: I initially tried using
href="<%= asset_path("favicon.svg")%."
instead, butfavicon.svg
is committed directly atpublic/assets/images/favicon.svg
, so Rails doesn't seem to actually have an asset path for it. I don't know why this was done, so I don't want to undo it. The file atpublic/assets/images/favicon.svg
does not seem to be the right favicon for the project.How is this tested? (please write tests!) 💖💪
Note: if you see a flake in your test build in github actions, please post in slack #casa "Flaky test: " :) 💪
Note: We love capybara tests! If you are writing both haml/js and ruby, please try to test your work with tests at every level including system tests like https://github.com/rubyforgood/casa/tree/main/spec/system
On
main
, in dev tools, you can see a 404 onGET http://0.0.0.0:3000/users/assets/images/favicon.svg
. On this branch, the favicon loads and is the expected CASA logo.I'm happy to add an automated test for this, but I wasn't sure where one belonged.
One important note is that during testing, I was not able to make the failure described at https://github.com/rubyforgood/casa/wiki/Flaky-tests#suspected-testing-tool-crash happen on purpose, so this is a bit of a speculative fix. But it does fix a 404 that was happening during local development, and that currently happens in prod on https://casavolunteertracking.org/users/sign_in
Screenshots please :)
Run your local server and take a screenshot of your work! Try to include the URL of the page as well as the contents of the page.
Before:
After:
browser tab:
network tools: