fixed the error message for custom fields
fixed the if structure and added a test
modified the test, but still something is wrong
altered the spec but still not working test
fixed the error message for custom fields and added a spec
use of regexp
Refactoring
Merge pull request #916 from opf/fix/error_message_custom_fields