unit test for user generates expected error