Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,14 @@ docker compose run test bin/rails test:system

### Notes

- **Minitest must stay on the 5.x series while on Rails 8.0.x.** Minitest 6.x
changed `run_suite`'s calling convention, which is incompatible with the Rails
8.0.x test runner (`railties` `test_unit/line_filtering`) and crashes
`bin/rails test` before any test runs (`wrong number of arguments` in
`line_filtering.rb`). The `Gemfile` pins `minitest ~> 5.25`; don't let it float
to 6.x. To verify app behavior when the harness is wedged, `rails runner` can
exercise code paths (helpers via `ApplicationController.helpers`, views via
`ApplicationController.render(template:, layout: false)`) without Minitest.
- The session store uses `CacheStore` (memcached), so the test environment
needs `config.cache_store = :memory_store` (not `:null_store`) for flash
and session data to persist across redirects
Expand Down
5 changes: 5 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,11 @@ group :development do
end

group :test do
# Pin minitest to the 5.x series: minitest 6.x changed run_suite's calling
# convention, which is incompatible with the Rails 8.0.x test runner
# (railties test_unit/line_filtering) and crashes `bin/rails test`.
gem 'minitest', '~> 5.25'

# System testing
# [https://guides.rubyonrails.org/testing.html#system-testing]
gem 'capybara'
Expand Down
5 changes: 2 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -302,9 +302,7 @@ GEM
mime-types-data (~> 3.2025, >= 3.2025.0507)
mime-types-data (3.2025.0924)
mini_mime (1.1.5)
minitest (6.0.3)
drb (~> 2.0)
prism (~> 1.5)
minitest (5.27.0)
msgpack (1.8.0)
multi_json (1.17.0)
multipart-post (2.4.1)
Expand Down Expand Up @@ -617,6 +615,7 @@ DEPENDENCIES
jsbundling-rails
letter_opener_web (~> 2.0)
lookbook (~> 2.3)
minitest (~> 5.25)
multi_json
mysql2
net-ftp
Expand Down
2 changes: 1 addition & 1 deletion app/views/errors/internal_server_error.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<%= content_tag :div, id: "bd", style: "clear: both; text-align: center; margin-top: 100px; margin-bottom: 100px;" do -%>
<h1>We're sorry but something has gone wrong. We have been notified of this error.</h1>
<h1>We're sorry, but something went wrong. Please try again later.</h1>
<% end -%>
14 changes: 14 additions & 0 deletions test/views/errors_view_test.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
require 'test_helper'

# Renders the error templates in isolation (no layout, no API calls) so the
# assertions are deterministic and fast.
class ErrorsViewTest < ActionView::TestCase
test 'internal server error page drops the stale "we have been notified" copy (ncbo#144)' do
html = render(template: 'errors/internal_server_error').to_s

refute_includes html, 'We have been notified',
'airbrake-era "we have been notified" claim should be removed'
assert_match(/something went wrong/i, html,
'page should still apologize for the error')
end
end
Loading