Fixed broken middleware tests by https://github.com/rails/rails/commit/207fa5c11ddf1cfd696f0eeb07d6466aae9d451e