Refactored controller tests with macros and shared examples