Refactor integration tests into controller tests