In this case I had to had a project in db to actually test that badge can not be deleted if it has projects.