A Santa Ana police detective testified Monday that she posed as an inmate and went undercover into the jail cell of a defendant in a high-profile beating case after the woman refused to talk with detectives and asked for an attorney.