added test cases for mailer and some controller methods