How to write test for controller in angularjs