test case written for model and controller