Write tests for error messages