From my experience dealing with followers in New Vegas, generally speaking:
- If you set them to "Use Ranged" they will pick the most powerful gun or energy weapon, with some level of preference towards their skill set. They will then fire the weapon at any enemies they encounter, regardless of whether using that weapon makes tactical sense. They will tend to run away from enemies that get too close, so you can watch them kiting enemies that tend to melee.
- If you set them to "Use Melee" they will pick the most powerful close-range weapon they possess (again, with some level of preference towards their skill set) and charge the enemy, regardless of the situation.
The "range" classification of the weapons is somewhat variable. For instance, Boone has a sniper rifle and a pistol by default, and a hunting knife is his close range weapon. Cass has a shotgun for a ranged weapon and a hunting knife as her close range weapon. Thus, if you give her a better shotgun, she will likely consider this her ranged weapon.
Additionally, the riot shotgun is more powerful than the All-American in terms of damage per shot and DPS. Therefore, her companion logic is likely to pick it as the preferred range weapon, even though its range is significantly less.
You're probably better off taking the shotgun back if you plan to engage at any kind of range with her. You can give her a different melee weapon if you want, although in my experience you generally have to explicitly instruct her to switch tactics if you want her to use it.