diff --git a/features/step_definitions/site.rb b/features/step_definitions/site.rb index c4e9986..dbfed04 100644 --- a/features/step_definitions/site.rb +++ b/features/step_definitions/site.rb @@ -94,7 +94,7 @@ end Then /^the prominently displayed meals should include a thumbnail image$/ do - response.should have_selector("img", :count => 10) + response.should have_selector(".meals img", :count => 10) end Then /^the prominently displayed meals should include the recipe titles$/ do @@ -106,15 +106,19 @@ click_link "Meal 0" end +When /^I click the site logo$/ do + click_link "/" +end + Then /^I should see the meal page$/ do response.should have_selector("h1", :content => "Meal 0") end -Then /^the Italian category should be highlighted$/ do +Then /^the (\w+) category should be highlighted$/ do |category| response.should have_selector("a", :class => "active", - :content => "Italian") + :content => category) end When /^I click on the recipe in the menu$/ do @@ -125,10 +129,13 @@ click_link "Italian" end +When /^I click the recipe link under the 6th meal$/ do + click_link "Recipe for Meal 5" +end Then /^I should see the recipe page$/ do response.should have_selector("h1", - :content => "Recipe for Meal 0") + :content => "Recipe for Meal ") end Then /^I should see 5 Italian recipes$/ do @@ -136,3 +143,7 @@ response.should have_selector("tr", :count => 6) end + +Then /^I should see the homepage$/ do + response.should have_selector(".meals h2", :count => 10) +end diff --git a/public/images/eee_corner.png b/public/images/eee_corner.png new file mode 100644 index 0000000..a436689 Binary files /dev/null and b/public/images/eee_corner.png differ diff --git a/views/layout.haml b/views/layout.haml new file mode 100644 index 0000000..ab5ed5c --- /dev/null +++ b/views/layout.haml @@ -0,0 +1,11 @@ +%html + %title= ["EEE Cooks", @title].compact.join(": ") +%body + #header + #eee-header-logo + %a{:href => "/"} + %img{:alt => "Home", :src => "/images/eee_corner.png"} + + = yield + + #footer