Avoid hardcoded magic number in test teardown.
Merge pull request #15857 from zuhao/refactor_activesupport_encoding_test

Avoid hardcoded magic number in test teardown.