Datasheet

Chapter 1: Building Resources
30
Figure 1-2
Asserting Creation
Let s tighten up the remaining recipe controller tests while adding ingredient functionality. The test for
creating a recipe asserts that the number of recipes changes, but it doesn t assert anything about the
entered data. So, I added the following:
def test_should_create_recipe
recipe_hash = { :title = > “Grandma’s Chicken Soup”,
:servings = > “5 to 7”,
:description = > “Good for what ails you”,
:ingredient_string = >
c01.indd 30c01.indd 30 1/30/08 4:02:30 PM1/30/08 4:02:30 PM