Refactor task controller tests