Cook pasta according to package instructions. Drain the pasta, reserving 1/2 cup (125 mL) of the water. Run pasta under cold water until completely chilled.
In a large non-stick skillet, heat oil over medium-high heat. Cook the onion until tender, about 5 min. Stir in the mushrooms and cook until golden and no liquid remains, about 5 min. Stir in the spinach, remove from heat and keep covered until the spinach is wilted, about 2 min. Uncover and let cool completely, if you wish to freeze and cook later. Stir in the cooked pasta, reserved pasta water, tomato sauce, ricotta and meatballs. Transfer to a freezer-proof baking dish. Sprinkle with mozzarella. Cover with foil and freeze at this point for baking later, if desired.
Bake covered with foil in a preheated 375°F (190°C) oven for 30 min. from frozen or 20 min. if baking from fresh. Uncover and bake for an additional 15 min. for frozen, 10 min. for fresh, until cheese is melted and bubbling.