Skip to content

Commit

Permalink
putting in the test excercises
Browse files Browse the repository at this point in the history
  • Loading branch information
Aditya Sanghi committed Aug 31, 2010
1 parent f594561 commit 8ec9567
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/helpers/application_helper.rb
@@ -1,5 +1,9 @@
module ApplicationHelper

def logo
image_tag("logo.png", :alt => "Sample App", :class => "round")
end

# Return a title on a per-page basis.
def title
base_title = "Ruby on Rails Tutorial Sample App"
Expand Down
1 change: 0 additions & 1 deletion app/views/layouts/_header.html.erb
@@ -1,5 +1,4 @@
<header>
<% logo = image_tag("logo.png", :alt => "Sample App", :class => "round") %>
<%= link_to logo, root_path %>
<nav class="round">
<ul>
Expand Down
13 changes: 13 additions & 0 deletions spec/requests/layout_links_spec.rb
Expand Up @@ -27,4 +27,17 @@
response.should have_selector('title', :content => "Sign up")
end

it "should have the right links on the layout" do
visit root_path
click_link "About"
response.should have_selector('title', :content => "About")
click_link "Help"
response.should # fill in
click_link "Contact"
response.should # fill in
click_link "Home"
response.should # fill in
click_link "Sign up now!"
response.should # fill in
end
end
6 changes: 6 additions & 0 deletions webrat.log
@@ -0,0 +1,6 @@
# Logfile created on Tue Aug 31 19:59:34 +0530 2010 by logger.rb/22285
REQUESTING PAGE: GET / with {} and HTTP headers {}
REQUESTING PAGE: GET /about with {} and HTTP headers {"HTTP_REFERER"=>"/"}
REQUESTING PAGE: GET /help with {} and HTTP headers {"HTTP_REFERER"=>"/about"}
REQUESTING PAGE: GET /contact with {} and HTTP headers {"HTTP_REFERER"=>"/help"}
REQUESTING PAGE: GET / with {} and HTTP headers {"HTTP_REFERER"=>"/contact"}

0 comments on commit 8ec9567

Please sign in to comment.