That’s correct. Elemental Affinity benefits one damage roll per casting of a spell, even if the spell allows more than one roll. So, for example, the feature improves one of the rays of a scorching ray spell or one of the beams of an eldritch blast spell.