Added test for exception message for validate method

- Test case for https://github.com/rails/rails/pull/16851
Merge pull request #17022 from prathamesh-sonpatki/test-for-validate-message

Added test for exception message for validate method