I was battling a Golurk and it used substitute, my Vileplume's effect spore still took effect though. I'm pretty sure that's not supposed to happen...
I did a test for it so here's the replay link.
http://play.pokemonshowdown.com/~~cbc.pokecommunity.com:8000/battle-nu3105