test wrriten for controller