Fixed failing tests.

Fixes the failing integration tests that @gaurish provided for [Issue #11502](https://github.com/rails/rails/issues/11502).