From 37d7f3fe8b9d68032fcdce71385457047f49a58d Mon Sep 17 00:00:00 2001 From: leefaisonr Date: Wed, 22 Mar 2023 16:59:55 -0400 Subject: [PATCH] Generated GuideCards controllers Co-authored-by: Bess Sadler --- app/controllers/guide_cards_controller.rb | 4 ++++ app/helpers/guide_cards_helper.rb | 2 +- app/views/guide_cards/index.html.erb | 2 ++ app/views/guide_cards/show.html.erb | 2 ++ config/routes.rb | 2 ++ spec/requests/guide_cards_spec.rb | 12 +++++++++++- spec/views/guide_cards/index.html.erb_spec.rb | 7 +++++++ spec/views/guide_cards/show.html.erb_spec.rb | 7 +++++++ 8 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 app/views/guide_cards/index.html.erb create mode 100644 app/views/guide_cards/show.html.erb create mode 100644 spec/views/guide_cards/index.html.erb_spec.rb create mode 100644 spec/views/guide_cards/show.html.erb_spec.rb diff --git a/app/controllers/guide_cards_controller.rb b/app/controllers/guide_cards_controller.rb index 1ed968a..5610ff1 100644 --- a/app/controllers/guide_cards_controller.rb +++ b/app/controllers/guide_cards_controller.rb @@ -1,4 +1,8 @@ # frozen_string_literal: true +# controller for GuideCards class GuideCardsController < ApplicationController + def index; end + + def show; end end diff --git a/app/helpers/guide_cards_helper.rb b/app/helpers/guide_cards_helper.rb index 43c1f0d..fc4fa32 100644 --- a/app/helpers/guide_cards_helper.rb +++ b/app/helpers/guide_cards_helper.rb @@ -1,5 +1,5 @@ # frozen_string_literal: true -# a helper for GuideCards +# helper for GuideCards module GuideCardsHelper end diff --git a/app/views/guide_cards/index.html.erb b/app/views/guide_cards/index.html.erb new file mode 100644 index 0000000..ce378a4 --- /dev/null +++ b/app/views/guide_cards/index.html.erb @@ -0,0 +1,2 @@ +

GuideCards#index

+

Find me in app/views/guide_cards/index.html.erb

diff --git a/app/views/guide_cards/show.html.erb b/app/views/guide_cards/show.html.erb new file mode 100644 index 0000000..dc37d90 --- /dev/null +++ b/app/views/guide_cards/show.html.erb @@ -0,0 +1,2 @@ +

GuideCards#show

+

Find me in app/views/guide_cards/show.html.erb

diff --git a/config/routes.rb b/config/routes.rb index a891cb2..6eb3aee 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -1,6 +1,8 @@ # frozen_string_literal: true Rails.application.routes.draw do + get 'guide_cards/index' + get 'guide_cards/show' resources :guide_cards # Define your application routes per the DSL in https://guides.rubyonrails.org/routing.html diff --git a/spec/requests/guide_cards_spec.rb b/spec/requests/guide_cards_spec.rb index 4db4d27..acc3a59 100644 --- a/spec/requests/guide_cards_spec.rb +++ b/spec/requests/guide_cards_spec.rb @@ -4,6 +4,16 @@ RSpec.describe 'GuideCards', type: :request do describe 'GET /index' do - pending "add some examples (or delete) #{__FILE__}" + it 'returns http success' do + get '/guide_cards/index' + expect(response).to have_http_status(:success) + end + end + + describe 'GET /show' do + it 'returns http success' do + get '/guide_cards/show' + expect(response).to have_http_status(:success) + end end end diff --git a/spec/views/guide_cards/index.html.erb_spec.rb b/spec/views/guide_cards/index.html.erb_spec.rb new file mode 100644 index 0000000..1fd373a --- /dev/null +++ b/spec/views/guide_cards/index.html.erb_spec.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe 'guide_cards/index.html.erb', type: :view do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/views/guide_cards/show.html.erb_spec.rb b/spec/views/guide_cards/show.html.erb_spec.rb new file mode 100644 index 0000000..7864cbb --- /dev/null +++ b/spec/views/guide_cards/show.html.erb_spec.rb @@ -0,0 +1,7 @@ +# frozen_string_literal: true + +require 'rails_helper' + +RSpec.describe 'guide_cards/show.html.erb', type: :view do + pending "add some examples to (or delete) #{__FILE__}" +end