writing tests for messaging