It is also reported from Ibn ʿUmar as a Prophetic hadith with the wording:
“Allah tests His servant with affliction, worry, and distress, until He leaves him as free of sin as refined silver.”
Ibn ʿAdī recorded it in al-Kāmil (1/169–170) through Abū Samurah Aḥmad ibn Sālim ibn Khālid ibn Jābir ibn Samurah … through his chain from him. He said:
“This Aḥmad ibn Sālim was a Kufan narrator who is not well known, and he has rejected hadiths.”
The hadith also has another route, with a good chain from Abū Hurayrah; its documentation has already been given under no. 2280.
*******
3394—“O people, this nation will be tested in their graves. When a person is buried and his companions have departed from him, an angel carrying a hammer comes to him and sits him up. He asks, ‘What do you say about this man?’ If he is a believer, he says, ‘I testify that there is no god but Allah and that Muhammad is His servant and His Messenger.’ The angel says, ‘You have spoken the truth.’ Then a gate to the Fire is opened for him, and he says, ‘This would have been your abode had you disbelieved in your Lord. But since you have believed, this is your abode.’ Then a gate to Paradise is opened for him. He seeks to rise towards it, but he is told, ‘Remain where you are!’ Then his grave is made spacious for him.
“But if he is a disbeliever or a hypocrite, he is asked, ‘What do you say about this man?’ He says, ‘I do not know. I heard people saying something.’ He is told, ‘May you neither know, nor recite, nor be guided!’ Then a gate to Paradise is opened for him, and he is told, ‘This would have been your abode had you believed in your Lord. But since you disbelieved in Him, Allah has given you this instead.’ Then a gate to the Fire is opened for him, and he is struck with the hammer such a blow that all Allah’s creatures hear it, except humans and jinn.”