···11+# Place all the behaviors and hooks related to the matching controller here.
22+# All this logic will automatically be available in application.js.
33+# You can use CoffeeScript in this file: http://coffeescript.org/
···11+// Place all the styles related to the StaticPages controller here.
22+// They will automatically be included in application.css.
33+// You can use Sass (SCSS) here: http://sass-lang.com/
···11+<% provide(:title, "About") %>
22+<h1>About</h1>
33+<p>
44+ <a href="https://railstutorial.jp/">Ruby on Rails Tutorial</a>
55+ is a <a href="https://railstutorial.jp/#ebook">book</a> and
66+ <a href="https://railstutorial.jp/#screencast">screencast</a>
77+ to teach web development with
88+ <a href="http://rubyonrails.org/">Ruby on Rails</a>.
99+ This is the sample application for the tutorial.
1010+</p>
···11+<% provide(:title, "Help") %>
22+<h1>Help</h1>
33+<p> Get help on the Ruby on Rails Tutorial at the
44+ <a href="https://railstutorial.jp/help">Rails Tutorial help
55+ page</a>.
66+ To get help on this sample app, see the
77+ <a href="https://railstutorial.jp/#ebook">
88+ <em>Ruby on Rails Tutorial</em> book</a>.
99+</p>
···11+<% provide(:title, "Home") %>
22+<h1>Sample App</h1>
33+<p>
44+ This is the home page for the
55+ <a href="https://railstutorial.jp/">Ruby on Rails Tutorial</a>
66+ sample application.
77+</p>
···11Rails.application.routes.draw do
22+ get 'static_pages/home'
33+ get 'static_pages/help'
44+ get 'static_pages/about'
55+26 # For details on the DSL available within this file, see http://guides.rubyonrails.org/routing.html
33- root 'application#hello'
77+ root 'static_pages#home'
48end
···11+# This file is auto-generated from the current state of the database. Instead
22+# of editing this file, please use the migrations feature of Active Record to
33+# incrementally modify your database, and then regenerate this schema definition.
44+#
55+# Note that this schema.rb definition is the authoritative source for your
66+# database schema. If you need to create the application database on another
77+# system, you should be using db:schema:load, not running all the migrations
88+# from scratch. The latter is a flawed and unsustainable approach (the more migrations
99+# you'll amass, the slower it'll run and the greater likelihood for issues).
1010+#
1111+# It's strongly recommended that you check this file into your version control system.
1212+1313+ActiveRecord::Schema.define(version: 0) do
1414+1515+end
···11+require 'test_helper'
22+33+class StaticPagesControllerTest < ActionDispatch::IntegrationTest
44+ def setup
55+ @base_title = "Ruby on Rails Tutorial Sample App"
66+ end
77+88+ test "should get home" do
99+ get static_pages_home_url
1010+ assert_response :success
1111+ assert_select "title", "Home | #{@base_title}"
1212+ end
1313+1414+ test "should get help" do
1515+ get static_pages_help_url
1616+ assert_response :success
1717+ assert_select "title", "Help | #{@base_title}"
1818+ end
1919+2020+ test 'should get about' do
2121+ get static_pages_about_url
2222+ assert_response :success
2323+ assert_select "title", "About | #{@base_title}"
2424+ end
2525+end