Malik related to me from Ibn Shihab from Ubaydullah ibn Abdullah ibn Utba ibn Masud that one of the Ansar came to the Messenger of Allah ﷺ with a black slave- girl of his. He said, "Messenger of Allah, I must set a slave free who is a mumina. If you think that she is mumina, I will free her." The Messenger of Allah ﷺ questioned her, "Do you testify that there is no god but Allah?" She said, "Yes." "Do you testify that Muhammad is the Messenger of Allah?" She said, "Yes." "Are you certain about the rising after death?" She said, "Yes." The Messenger of Allah ﷺ said, "Free her."
أَنَّ رَجُلاً مِنَ الأَنْصَارِ جَاءَ إِلَى رَسُولِ اللَّهِ ﷺ بِجَارِيَةٍ لَهُ سَوْدَاءَ فَقَالَ يَا رَسُولَ اللَّهِ إِنَّ عَلَىَّ رَقَبَةً مُؤْمِنَةً فَإِنْ كُنْتَ تَرَاهَا مُؤْمِنَةً أُعْتِقُهَا فَقَالَ لَهَا رَسُولُ اللَّهِ ﷺ أَتَشْهَدِينَ أَنْ لاَ إِلَهَ إِلاَّ اللَّهُ قَالَتْ نَعَمْ قَالَ أَتَشْهَدِينَ أَنَّ مُحَمَّدًا رَسُولُ اللَّهِ قَالَتْ نَعَمْ قَالَ أَتُوقِنِينَ بِالْبَعْثِ بَعْدَ الْمَوْتِ قَالَتْ نَعَمْ فَقَالَ رَسُولُ اللَّهِ ﷺ أَعْتِقْهَا