Fixed failing tests.

Fixes the failing integration tests that @gaurish provided for rails/rails#11502.