The Jataka, Volume I, tr. by Robert Chalmers, , at sacred-texts.com
"As they who ate."--This story was told by the Master while at Jetavana, about a concupiscent Brother. Tradition says there was a scion of a good family who gave his heart to the Buddha's doctrine and joined the Brotherhood. But one day as he was going his round for alms in Sāvatthi, he was there stirred to concupiscence by the sight of a beautifully dressed woman. Being brought by his teachers and directors before the Master, he admitted in answer to the enquiries of the Blessed One that the spirit of concupiscence had entered into him. Then said the Master, "Verily the five lusts of the senses are sweet in the hour of actual enjoyment, Brother; but this enjoyment of them (in that it entails the miseries of re-birth in hell and the other evil states) is like the eating of the fruit of the What-fruit tree. Very fair to view is the What-fruit, very fragrant-and sweet; but when eaten, it racks the inwards and brings death. In other days, through ignorance  of its evil nature, a multitude of men, seduced by the beauty, fragrance and sweetness of the fruit, ate thereof so that they died." So saying, he told this story of the past.
Once upon a time when Brahmadatta was reigning in Benares, the Bodhisatta came to life as the leader of a caravan. Once when journeying with five hundred carts from East to West, he came to the outskirts of a forest. Assembling his men, he said to them:--"In this forest grow trees that bear poisonous fruit. Let no man eat any unfamiliar fruit without first asking me." When they had traversed the forest, they came at the other border on a What-fruit tree with its boughs bending low with their burthen of fruit. In form, smell and taste, its trunk, boughs, leaves and fruit resembled a mango. Taking the tree, from its misleading appearance and so forth, to be a mango, some plucked the fruit and ate; but others said, "Let us speak to our leader before we eat." And these latter, plucking the fruit, waited for him to come up. When he came, he ordered them to fling away the fruit they had plucked, and had an emetic administered to those who had already eaten. Of these latter, some recovered; but such as had been the first to eat, died. The Bodhisatta reached his destination in safety, and sold his wares at a profit, after which he travelled home again. After a life spent in charity and other good works, he passed away to fare according to his deserts.
It was when he had told this story, that the Master, as Buddha, uttered this stanza:--
Having thus shewn that the Lusts, which are so sweet in the hour of fruition, end by slaying their votaries, the Master preached the Four Truths, at the close  whereof the concupiscent Brother was converted and won the Fruit of the First Path. Of the rest of the Buddha's following some won the First, some the Second, and some the Third Path, whilst others again became Arahats.
His lesson ended, the Master identified the Birth by saying, "My disciples were the people of the caravan in those days, and I their leader."