Skip to content

Commit

Permalink
テスト&aboutページ設定追加
Browse files Browse the repository at this point in the history
  • Loading branch information
ryo-i committed May 5, 2024
1 parent f0e7fc6 commit e6ab318
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 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
9 changes: 9 additions & 0 deletions app/views/static_pages/about.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<h1>About</h1>
<p>
<a href="https://railstutorial.jp/">Ruby on Rails Tutorial</a>
is a <a href="https://railstutorial.jp/#ebook">book</a> and
<a href="https://railstutorial.jp/screencast">screencast</a>
to teach web development with
<a href="https://rubyonrails.org/">Ruby on Rails</a>.
This is the sample app for the tutorial.
</p>
6 changes: 1 addition & 5 deletions config/routes.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
Rails.application.routes.draw do
get 'static_pages/home'
get 'static_pages/help'
get "static_pages/about"
root "application#hello"

# Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html

# Defines the root path route ("/")
# root "articles#index"
end
14 changes: 14 additions & 0 deletions db/schema.rb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions test/controllers/static_pages_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,9 @@ class StaticPagesControllerTest < ActionDispatch::IntegrationTest
get static_pages_help_url
assert_response :success
end

test "should get about" do
get static_pages_about_url
assert_response :success
end
end

0 comments on commit e6ab318

Please sign in to comment.