refactor send_invite view and test