Selena Gomez took some time off to focus on her health after revealing she's suffering from lupus ... and she also used some of that time off to rock out to Britney Spears, who is famously her idol. And she looked so good doing it that even Rihanna complimented her!

Gomez was caught on camera dancing to 'Til the World Ends' with her pal and fellow Spears stan Katy Perry, which you can peek at in the video above. (It's clear that none of them have as much rhythm has Spears herself!)

Interestingly enough, one person who wasn't spotted near Gomez? Miley Cyrus. Guess old habits and frenemies die hard!