function testing controller