If you see the default Rails 404 page, you probably forgot to remove public/404.html.
If you want to make sure it actually works, change config/environments/development.rb to say
# Do not commit!config.consider_all_requests_local=false
instead of true.
Just don’t keep that value, since you’ll get less helpful errors in development, and you’ll also disable the /rails/info/properties page with debug info.
I haven’t been able to figure out a way to do production-style error handling in a single test, so I settled for this:
require"rails_helper"describe"404 page"doit"is customized"do# Haven't been able to get the "show instead of exceptions" thing working in tests, but this at least makes sure the page can render correctly.visit"/404"expect(page.status_code).toeq404expect(page).tohave_content("Sorry!")endend