controller tests refactored