What you describe is legal, but I personally consider it bad design to put the frige on with the countertop receptacles. I generally dedicate a circuit to the frige. The code does require that the refrigeration equipment be served by the two or more small appliance circuits.
210.52
(B) Small Appliances
(1) Receptacle Outlets Served In the kitchen, pantry,
breakfast room, dining room, or similar area of a dwelling unit, the two or more 20-ampere small-appliance branch circuits required by 210.11©(1) shall serve all wall and floor receptacle outlets covered by 210.52(A), all countertop outlets covered by 210.52©, and receptacle outlets for refrigeration equipment.
Exception No. 2: The receptacle outlet for refrigeration* equipment shall be permitted to be supplied from an individual branch circuit rated 15 amperes or greater.
*