refactored application controller test