Heat a large cast iron skillet with half the oil over medium heat. Add onions and cook until soft, about 3 minutes and then add garlic and cook for 30 seconds. Add black beans and corn, and cook for 2 minutes. Lastly, add the spinach and cook for 1 minute until wilted, season with salt and pepper. Remove vegetables from the pan to a bowl and set aside.
Add remaining oil and grated potato to the skillet. Cook for 3 minutes until the potato is soft and begins to brown, then flatten and press the potatoes into the base of the skillet to make the bottom crust. Spread cooked vegetables over the top of the potato crust. Set aside.
In a bowl, scramble eggs with a fork and pour over the vegetables, tilting the pan to spread the eggs evenly over the top. Season with salt and pepper to taste. Sprinkle grated cheese over the top and bake in preheated oven for 10-15 minutes until eggs are cooked and cheese is browned. Remove from oven and let stand for 10 minutes. Garnish with tomatoes and cilantro, cut into portions and enjoy!