The idea of venting the attic is to keep the roof underlayment cold so ice won't melt and sneak under the shingles to form an ice dam. That happens on one portion of my roof which causes water to leak into my porch.
I didn't have the problem until I installed a pellet stove in the porch/kitchen area of my home. That part of the house was always the coolest... now it's the warmest. There isn't sufficient venting in the attic space to cool the roof... a problem I plan on foxing next summer.
Spray foam, I think, would give a total thermal break between the attic and the roof keeping the roof cold and the ice dams away... it would still be best if you ventilated the attic.