Permalink
Browse files

Finished static pages.

  • Loading branch information...
shef2000 committed May 21, 2012
1 parent ccba1af commit 794c9b8c936754bf9ea54d981f811dd252555857
@@ -4,4 +4,7 @@ def home
def help
end
+
+ def about
+ end
end
@@ -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 %>
@@ -0,0 +1,8 @@
+<% provide(:title, 'About Us') %>
+<h1>About Us</h1>
+<p>
+ The <a href="http://railstutorial.org/">Ruby on Rails Tutorial</a>
+ is a project to make a book and screencasts to teach web development
+ with <a href="http://rubyonrails.org/">Ruby on Rails</a>. This
+ is the sample application for the tutorial.
+</p>
@@ -1,2 +1,8 @@
-<h1>StaticPages#help</h1>
-<p>Find me in app/views/static_pages/help.html.erb</p>
+<% provide(:title, 'Help') %>
+<h1>Help</h1>
+<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>
@@ -1,2 +1,9 @@
-<h1>StaticPages#home</h1>
-<p>Find me in app/views/static_pages/home.html.erb</p>
+<% 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>
+ sample application.
+</p>
+
+
View
@@ -1,7 +1,6 @@
SampleApp::Application.routes.draw do
get "static_pages/home"
-
get "static_pages/help"
-
+ get "static_pages/about"
end
@@ -0,0 +1,40 @@
+require 'spec_helper'
+
+describe "StaticPages" do
+ describe "Home page" 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_selector('title',
+ :text => "Ruby on Rails Tutorial Sample App | Home")
+ end
+ end
+
+ describe "Help page" 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_selector('title',
+ :text => "Ruby on Rails Tutorial Sample App | Help")
+ end
+ end
+
+ describe "About page" do
+ it "should have the h1 'About Us'" do
+ visit '/static_pages/about'
+ 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 794c9b8

Please sign in to comment.