From 41b1c0bb047c6886fa14909748ce2b1614cacb17 Mon Sep 17 00:00:00 2001 From: Alex Kotov Date: Fri, 23 Nov 2018 23:57:09 +0500 Subject: [PATCH] Add action HomeController#show --- app/controllers/home_controller.rb | 6 ++++++ app/views/home/show.html.erb | 0 config/routes.rb | 2 +- spec/requests/{default_spec.rb => root_spec.rb} | 4 ---- 4 files changed, 7 insertions(+), 5 deletions(-) create mode 100644 app/controllers/home_controller.rb create mode 100644 app/views/home/show.html.erb rename spec/requests/{default_spec.rb => root_spec.rb} (71%) diff --git a/app/controllers/home_controller.rb b/app/controllers/home_controller.rb new file mode 100644 index 0000000..6690f6c --- /dev/null +++ b/app/controllers/home_controller.rb @@ -0,0 +1,6 @@ +# frozen_string_literal: true + +class HomeController < ApplicationController + # GET / + 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..e69de29 diff --git a/config/routes.rb b/config/routes.rb index a128e1e..8590439 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true Rails.application.routes.draw do - root to: ->(_) { [200, {}, ['Hello, World!']] } + root to: 'home#show' resources :membership_applications, only: :new end diff --git a/spec/requests/default_spec.rb b/spec/requests/root_spec.rb similarity index 71% rename from spec/requests/default_spec.rb rename to spec/requests/root_spec.rb index 9783585..6919efb 100644 --- a/spec/requests/default_spec.rb +++ b/spec/requests/root_spec.rb @@ -10,8 +10,4 @@ RSpec.describe 'GET /' do specify do expect(response).to have_http_status :ok end - - specify do - expect(response.body).to match 'Hello, World!' - end end