Testing: How to test that view contains desired data
Say a Chef can make Recipes, and Sous-Chefs can create Recipes that must be approved by a Head Chef. You want to test that, when a Head Chef views her homepage, she sees Recipes that she herself created. You also want to test that she sees there are Recipes awaiting her approval. I can think of two ways to do this: Test that the view contains certain words, like "Your recipes" and "Recipes awaiting your approval" Add unnecessary attributes to the html elements you're using so that you can check for an element with "id=recipe_1" or "data-for-the-sake-of-testing=1" I very much dislike both of