Skip to content

Commit

Permalink
Finish static pages
Browse files Browse the repository at this point in the history
  • Loading branch information
saft committed Feb 1, 2013
1 parent a6f6d05 commit 474bfa1
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 15 deletions.
2 changes: 1 addition & 1 deletion app/views/layouts/application.html.erb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<!DOCTYPE html>
<html>
<head>
<title>SampleApp</title>
<title>Ruby on Rails Tutorial Sample App | <%= yield(:title) %></title>
<%= stylesheet_link_tag "application", :media => "all" %>
<%= javascript_include_tag "application" %>
<%= csrf_meta_tags %>
Expand Down
6 changes: 2 additions & 4 deletions app/views/static_pages/about.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
<% provide(:title, 'About Us') %>
<h1>About Us</h1>
<p>
Blah blah blah..
</p>

<p>blay blah blah</p>
8 changes: 7 additions & 1 deletion app/views/static_pages/help.html.erb
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
<% provide(:title, 'Help') %>
<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>
<p>
Get help on the Ruby on Rails tutorial at the
<a href="http://railstutorial.org/help">Rails Tutorial help page</a>
To get help on this sample app, see the
<a href="http://railstutorial.org/book">Rails Tutorial book</a>
</p>
8 changes: 5 additions & 3 deletions app/views/static_pages/home.html.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<% provide(:title, 'Home') %>
<h1>Sample App</h1>
<p>
This is the home page for the
<a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
</p>

<p>
This is the home page for the <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a> sample application.
</p>
28 changes: 22 additions & 6 deletions spec/requests/static_pages_spec.rb
Original file line number Diff line number Diff line change
@@ -1,22 +1,38 @@
require 'spec_helper'

describe "StaticPages" do

describe "Home page" do
it "should have the content 'Sample App'" do
it "should have the h1 'Sample App'" do
visit '/static_pages/home'
page.should have_selector('h1', :text => 'Sample App')
end
it "should have the title 'Home'" do
visit '/static_pages/home'
page.should have_content('Sample App')
page.should have_selector('title', :text => "Ruby on Rails Tutorial Sample App | Home")
end
end

describe "Help page" do
it "should have the content 'Sample App'" do
it "should have the h1 'Help'" do
visit '/static_pages/help'
page.should have_selector('h1', :text => 'Help')
end
it "should have the title 'Help'" do
visit '/static_pages/help'
page.should have_content('Help')
page.should have_selector('title', :text => "Ruby on Rails Tutorial Sample App | Help")
end
end

describe "About page" do
it "should have the content 'About Us'" do
it "should have the h1 'About Us'" do
visit '/static_pages/about'
page.should have_content('About Us')
page.should have_selector('h1', :text => 'About Us')
end
it "should have the title 'About Us'" do
visit '/static_pages/about'
page.should have_selector('title', :text => "Ruby on Rails Tutorial Sample App | About Us")
end
end

end

0 comments on commit 474bfa1

Please sign in to comment.