The answer is no. No it doesn't cleanse your system of THC. You friends have been the victims of drug-testing folklore. Cranberry juice is not even a diuretic. It's just an acidic juice that acidifies urine and thus is mildly helpful in fighting bacterial urinary tract infections.

The fact that your friend passed his drug test was either a lucky coincidence (it takes a while for the cannabis metabolites to get to detectable levels) or else he'd simply not used enough that he tested positive at that time.