Heat the oil in a frying pan, and cook the onion, garlic and mushrooms over a medium heat for 5 minutes, until the onion is soft and translucent. During the last minute add the spinach to the pan.
Meanwhile, in a bowl lightly beat the eggs with milk and some black pepper.
In a separate bowl, combine the salt and ricotta.
Transfer the onions to an oven-proof dish. Pour the egg mixture evenly over the onions, and dollop the ricotta mixture on top, ensuring that all areas of the frittata get some ricotta.
Bake in the oven for around 20 minutes at 375°F, until the eggs have set.