Skip to content

Commit

Permalink
Static pages.
Browse files Browse the repository at this point in the history
  • Loading branch information
saft committed Jan 31, 2013
1 parent 039e724 commit a6f6d05
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 4 deletions.
3 changes: 3 additions & 0 deletions app/controllers/static_pages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,7 @@ def home

def help
end

def about
end
end
5 changes: 5 additions & 0 deletions app/views/static_pages/about.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<h1>About Us</h1>
<p>
Blah blah blah..
</p>

4 changes: 2 additions & 2 deletions app/views/static_pages/help.html.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<h1>StaticPages#help</h1>
<p>Find me in app/views/static_pages/help.html.erb</p>
<h1>Help</h1>
<p>Get help on the Ruby on Rails Tutorial at the Rails Tutorial help page. To get help on this sample app see the Rails Tutorial book.</p>
7 changes: 5 additions & 2 deletions app/views/static_pages/home.html.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,5 @@
<h1>StaticPages#home</h1>
<p>Find me in app/views/static_pages/home.html.erb</p>
<h1>Sample App</h1>

<p>
This is the home page for the <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a> sample application.
</p>
2 changes: 2 additions & 0 deletions config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
get "static_pages/home"

get "static_pages/help"

get "static_pages/about"

# The priority is based upon order of creation:
# first created -> highest priority.
Expand Down
22 changes: 22 additions & 0 deletions spec/requests/static_pages_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
require 'spec_helper'

describe "StaticPages" do
describe "Home page" do
it "should have the content 'Sample App'" do
visit '/static_pages/home'
page.should have_content('Sample App')
end
end
describe "Help page" do
it "should have the content 'Sample App'" do
visit '/static_pages/help'
page.should have_content('Help')
end
end
describe "About page" do
it "should have the content 'About Us'" do
visit '/static_pages/about'
page.should have_content('About Us')
end
end
end

0 comments on commit a6f6d05

Please sign in to comment.