Ibn Ishaq recorded that when the spirit came to Muhammad another time, Khadija tested him:
Isma`il b. Abu Hakim, a freedman of the family of al-Zubayr, told me on Khadija's authority that she said to the apostle of Allah, 'O son of my uncle, are you able to tell me about your visitant, when he comes to you?" He replied that he could, and she asked him to tell her when he came.
So when Gabriel came to him, as he was wont, the apostle said to Khadija, 'This is Gabriel who has just come to me.' `Get up, O son of my uncle,' she said,
`and sit by my left thigh.'
The apostle did so, and she said, `Can you see him?' `Yes,' he said. She said,
`Then turn around and sit on my right thigh.' He did so, and she said, `Can you see him?' When he said that he could she asked him to move and sit in her lap.
When he had done this she again asked if he could see him, and when he said yes, she disclosed her form and cast aside her veil while the apostle was sitting in her lap. Then she said, `Can you see him?' And he replied, `No.' She said, `O son of my uncle, rejoice and be of good heart, by Allah he is an angel and not a satan.
(Ibn Ishaq, The Life of Muhammad, tr. Guillaume, 1967, p. 107)
Abed El Malak Bin Hisham wrote the biography of Mohammed and he mentions that when Mohammed was at the cave of Hira, outside of Mecca, he was alone, when a spirit came and squeezed him, and told him, "Read." He went to this wife scared. And he continued to be in doubt of what happened to him. And one day, his wife Khadijah said to him, "Mohammed, let us put that on a test. When the spirit comes to you, tell me, and we will test if that spirit is really Gabriel the angel, or a bad spirit." He said OK.
One day, he was sitting with her, and he said, "Khadijah, the spirit came!" She said, "Come, and sit on my right side." So, he sat on her right side. She said, "Mohammed, do you see the spirit?" He said, "Yes." She said, "Then sit on my left side." So, he switched and he sat on her left side. "Do you see the spirit?"Khadijah asked. "Yes," Mohammed answered. "Then sit on my lap." He sits on her lap. "Do you still see the spirit?" "Yes," Mohammed answered. Then she uncovered herself to show some of her feminine parts of body. And then she said, "Do you see the spirit?" He said, "No." She said, "That spirit is good because he doesn't want to see my feminine part. You are the prophet of Allah." And by that he came to be convinced that that spirit who was talking to him was the angel Gabriel, and a good spirit, because when he saw his wife almost naked, he didn't stay to see.