Skip to content

Commit

Permalink
finished Ch 3 regular
Browse files Browse the repository at this point in the history
  • Loading branch information
kdironside committed May 18, 2012
1 parent 848db5e commit 973d6a0
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 0 deletions.
3 changes: 3 additions & 0 deletions app/controllers/static_pages_controller.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -7,5 +7,8 @@ def help


def about def about
end end

def contact
end


end end
6 changes: 6 additions & 0 deletions app/views/static_pages/contact.html.erb
Original file line number Original file line Diff line number Diff line change
@@ -0,0 +1,6 @@
<% provide(:title, 'Contact') %>
<h1>Contact</h1>
<p>
Contact Ruby on Rails Tutorial about the sample app at the
<a href="http://railstutorial.org/contact">contact page</a>.
</p>
1 change: 1 addition & 0 deletions config/routes.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
get "static_pages/home" get "static_pages/home"
get "static_pages/about" get "static_pages/about"
get "static_pages/help" get "static_pages/help"
get "static_pages/contact"


end end
14 changes: 14 additions & 0 deletions spec/requests/static_pages_spec.rb
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -43,4 +43,18 @@
:text => "Ruby on Rails Tutorial Sample App | About Us") :text => "Ruby on Rails Tutorial Sample App | About Us")
end end
end end

describe "Contact page" do

it "should have the h1 'Contact'" do
visit '/static_pages/contact'
page.should have_selector('h1', :text => 'Contact')
end

it "should have the title 'Contact'" do
visit '/static_pages/contact'
page.should have_selector('title', :text => "Ruby on Rails Tutorial Sample App | Contact")
end
end

end end

0 comments on commit 973d6a0

Please sign in to comment.