test the view function