Factor regex error messages with spec API tests

https://github.com/gitlabhq/gitlabhq/pull/7516#issuecomment-61804689