Merge pull request #8491 from igagnidz/master

Issue #8442
Improve the test code for #8422

* Remove unneeded comments.
* Use key? instead of keys.include?.