From 084f3e9b0df65d5ce4dcb5227db54418fe55af75 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Wed, 10 Mar 2021 14:20:04 +0500 Subject: [PATCH] Add action HomeController#show --- app/controllers/home_controller.rb | 4 ++++ app/views/home/show.html.erb | 1 + app/views/layouts/application.html.erb | 2 +- config/routes.rb | 3 ++- test/controllers/home_controller_test.rb | 8 ++++++++ 5 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 app/controllers/home_controller.rb create mode 100644 app/views/home/show.html.erb create mode 100644 test/controllers/home_controller_test.rb diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb new file mode 100644 index 0000000..89ff5b1 --- /dev/null +++ b/app/controllers/home_controller.rb @@ -0,0 +1,4 @@ +class HomeController < ApplicationController + def show + end +end diff --git a/app/views/home/show.html.erb b/app/views/home/show.html.erb new file mode 100644 index 0000000..ea70fb8 --- /dev/null +++ b/app/views/home/show.html.erb @@ -0,0 +1 @@ +

Decentralized Microblog

diff --git a/app/views/layouts/application.html.erb b/app/views/layouts/application.html.erb index c4a69cf..2bfdd8d 100644 --- a/app/views/layouts/application.html.erb +++ b/app/views/layouts/application.html.erb @@ -1,7 +1,7 @@ - LessonDecentralizedMicroblogInRuby + Decentralized Microblog <%= csrf_meta_tags %> <%= csp_meta_tag %> diff --git a/config/routes.rb b/config/routes.rb index c06383a..cc42f6a 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,3 +1,4 @@ Rails.application.routes.draw do - # For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html + get 'home/show' + root to: 'home#show' end diff --git a/test/controllers/home_controller_test.rb b/test/controllers/home_controller_test.rb new file mode 100644 index 0000000..9c4989c --- /dev/null +++ b/test/controllers/home_controller_test.rb @@ -0,0 +1,8 @@ +require "test_helper" + +class HomeControllerTest < ActionDispatch::IntegrationTest + test "should get show" do + get home_show_url + assert_response :success + end +end