Heat a skillet over medium heat. Add olive oil, then onions. Saute onions until soft, about 5 minutes. Add mushrooms and saute 5 minutes more, stirring occasionally. Add spinach and cook just until wilted, about 1 minute.
In a large mixing bowl combine ricotta, parmesan, and egg. Mix well, then add spinach mixture. Stir thoroughly. Add salt and pepper to taste.
Spread mixture into pastry-lined pan. Cover with second circle of pastry. Trim and seal edges. Cut steam vents in top.
Bake in preheated oven for 35 to 45 minutes, or until crust is golden brown.