Today we'll be touring the wondrous Ruby on Rails chocolate factory to see how its marvelous candy, consumed by web apps and developers everywhere, is made and tested.
This pull request added documentation for config/puma.rb to recommend closing database connections if preloading an application that uses Active Record. See the discussions in the pull request and in puma/puma#1001 for more.
To improve productivity when writing tests, if an assert_response test fails, Rails nows outputs the actual response body if it's not too large (less than or equal to 500 chars).
Following-up on a very good bug report, this PR fixed a Rails 5 regression so that calling ActiveRecord#touch when using optimistic locking once again leaves the model in a non-dirty state with no attribute changes.
Tests using ActionDispatch::IntegrationTest were failing when run after any controller test that modified request.session_options. It turned out thatย ActionController::TestSession::DEFAULT_OPTIONS was being mutated, and as a result, Rack::Session::Abstract::Persisted::DEFAULT_OPTIONS also, which made integration tests inherit that value and fail.
This pull request dup'ed the AC default options constant to prevent mutation, and a pull request to Rack was merged to freeze the Rack default options constant and avoid the issue in the future.
Running the Rails test suite can be a great way to uncover minor issues to fix. This pull request addressed 2 warnings in the test suite that arose simply from not wrapping a method argument in parentheses.
Better documentation is always welcome. After seeing issue #26286, this contributor helpfully improved the documentation for the render partial 'as' option.
The commit message says it all: "I created this for testing migrations in isolation and thought it would be helpful to others in the future to avoid having to dig through the Rails migration tests."