Before moving on to "real" work, I run all of my tests only to find that I have several errors. There are many errors in the
11)All eleven errors are caused by the inclusion of the
NoMethodError in 'meal.haml should wikify the meal's description'
undefined method `' for nil:NilClass
recipe_category_linkhelper last night. I am not able to stub out the method, so I seed some dummy data in the
before(:each)block to eliminate the errors:
assigns[:recipes] = This prevents the
recipe_category_linkfrom acting upon a
@recipesarray when building the category links:
%ul#eee-categoriesNext up, it is back to the Cucumber scenario. Specifically, I need to mark a few scenario steps as complete in the navigation-from-the-homepage Cucumber scenario. Yesterday, I was able to verify that a user could navigate from the homepage to a recent meal. I also ensured that site-wide categories were displaying on the same meal page.
%li= recipe_category_link(@recipes, 'Italian')
%li= recipe_category_link(@recipes, 'Asian')
Now, I need to ensure that the user can navigate from the meal down to a recipe listed on the menu. Cucumber tells me that I can implement the missing steps with:
When /^I click on the recipe in the menu$/ doAs mentioned, the scenario so far involves clicking on the most recently prepared meal, then clicking on the recipe on that meal's menu. The meals created for this scenario have titles: "Meal 0", "Meal 1", "Meal 2", etc. In turn, the recipes for each meal are named simply: "Recipe for Meal 0", "Recipe for Meal 1", "Recipe for Meal 2", etc. So, to click on the recipe for the first meal, I need to look for a link to "Recipe for Meal 0":
Then /^I should see the recipe page$/ do
When /^I click on the recipe in the menu$/ doSimilarly, to verify that I am on the appropriate recipe page, I check the
click_link "Recipe for Meal 0"
Then /^I should see the recipe page$/ doThe next step in the scenario, that the Italian category should be highlighted for this Italian recipe, was implemented last night. The step was written for the meal (the meal is Italian because it has an Italian recipe on the menu), but applies to category links on the recipe page just as it does on the meal page.
:content => "Recipe for Meal 0")
And just like that, I am done with 14 of the 21 steps in the scenario:
Before moving onto the next steps, I think there are some DRY violations in the category links that I need to address. Tomorrow.