unit test for controller