Narrated Humaid bin 'Abdur-Rahman bin 'Awf:
that Marwan bin Al-Hakam said: Go O Rafi' - who was his gate-keeper - to Ibn 'Abbas and say to him: 'If every person who rejoices with what he has done, and loves to be praised for what he has not done, will be punished, then we will all be punished.' So Ibn 'Abbas said: 'This Ayah has got nothing to do with you. This was only revealed about the People of the Book.' Then Ibn 'Abbas recited: When Allah took a covenant from those who were given the Scripture to make it known and clear to mankind... (3:187) and he recited: Think not that those who rejoice in what they have done, and love to be praised for what they have not done... (3:188) Ibn 'Abbas said: 'The Prophet (ﷺ) asked them about something, and they concealed it, and told him about something else. So they left wanting him to think that they informed him about what he asked them, and wanting to be praised for that by him, and they were rejoicing over what they had concealed, and the fact that they were asked about it.