'Testing: how to access "model_has_error_on_field"?

I was looking at Mastodon tests for inspiration, and I noticed this model_has_error_on_field method on their User model tests.

Anyone know from where this method is defined and how could I access it in my test suite ?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source