refactored with content_tag and added test to verify flash message worked