From 2d8ef241d080b699447d42d0168c1a38f001ad35 Mon Sep 17 00:00:00 2001 From: Chris Preisinger Date: Mon, 26 Aug 2024 20:05:46 -0400 Subject: [PATCH] [127] Create Evaluator route, controller, view (#133) * 127 Placeholder evaluator files --------- Co-authored-by: Stephen Chudleigh --- app/controllers/evaluations_controller.rb | 5 +++++ app/helpers/evaluations_helper.rb | 4 ++++ app/views/evaluations/index.html.erb | 7 +++++++ config/routes.rb | 1 + spec/helpers/evaluations_helper_spec.rb | 15 +++++++++++++++ spec/requests/evaluations_spec.rb | 11 +++++++++++ 6 files changed, 43 insertions(+) create mode 100644 app/controllers/evaluations_controller.rb create mode 100644 app/helpers/evaluations_helper.rb create mode 100644 app/views/evaluations/index.html.erb create mode 100644 spec/helpers/evaluations_helper_spec.rb create mode 100644 spec/requests/evaluations_spec.rb diff --git a/app/controllers/evaluations_controller.rb b/app/controllers/evaluations_controller.rb new file mode 100644 index 00000000..0d2c5fbc --- /dev/null +++ b/app/controllers/evaluations_controller.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +class EvaluationsController < ApplicationController + def index; end +end diff --git a/app/helpers/evaluations_helper.rb b/app/helpers/evaluations_helper.rb new file mode 100644 index 00000000..81a87ad7 --- /dev/null +++ b/app/helpers/evaluations_helper.rb @@ -0,0 +1,4 @@ +# frozen_string_literal: true + +module EvaluationsHelper +end diff --git a/app/views/evaluations/index.html.erb b/app/views/evaluations/index.html.erb new file mode 100644 index 00000000..c4b53c2e --- /dev/null +++ b/app/views/evaluations/index.html.erb @@ -0,0 +1,7 @@ +
+
+

Evaluations

+ +

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

+
+
diff --git a/config/routes.rb b/config/routes.rb index bf9cb130..de504102 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -8,6 +8,7 @@ get '/', to: "dashboard#index" get '/dashboard', to: "dashboard#index" + resources :evaluations, only: [:index] resources :evaluation_forms, only: [:index] resources :manage_submissions, only: [:index] diff --git a/spec/helpers/evaluations_helper_spec.rb b/spec/helpers/evaluations_helper_spec.rb new file mode 100644 index 00000000..8ff2a1f0 --- /dev/null +++ b/spec/helpers/evaluations_helper_spec.rb @@ -0,0 +1,15 @@ +require 'rails_helper' + +# Specs in this file have access to a helper object that includes +# the EvaluationsHelper. For example: +# +# describe EvaluationsHelper do +# describe "string concat" do +# it "concats two strings with spaces" do +# expect(helper.concat_strings("this","that")).to eq("this that") +# end +# end +# end +RSpec.describe EvaluationsHelper do + pending "add some examples to (or delete) #{__FILE__}" +end diff --git a/spec/requests/evaluations_spec.rb b/spec/requests/evaluations_spec.rb new file mode 100644 index 00000000..4879e820 --- /dev/null +++ b/spec/requests/evaluations_spec.rb @@ -0,0 +1,11 @@ +require 'rails_helper' + +RSpec.describe "Evaluations" do + describe "GET /index" do + it "returns http success" do + get "/evaluations" + expect(response).to have_http_status(:success) + expect(response.body).to include("Evaluations") + end + end +end