Unit test for fixing error mail not being send out