unit test for referral