Write apps controller tests