From e159373b11d706ea5b919c320bcf7c38dd9ff108 Mon Sep 17 00:00:00 2001 From: baarkerlounger Date: Mon, 29 Nov 2021 18:12:33 +0000 Subject: [PATCH] Rubocop --- app/controllers/application_controller.rb | 2 +- app/helpers/check_answers_helper.rb | 4 ++-- app/helpers/tasklist_helper.rb | 4 ++-- spec/controllers/case_logs_controller_spec.rb | 2 +- spec/features/form/check_answers_page_spec.rb | 4 ++-- spec/features/form/conditional_questions_spec.rb | 2 +- spec/features/form/form_navigation_spec.rb | 2 +- spec/features/form/page_routing_spec.rb | 2 +- spec/features/form/saving_data_spec.rb | 2 +- spec/features/form/tasklist_page_spec.rb | 4 ++-- spec/features/form/validations_spec.rb | 6 +++--- spec/requests/case_log_controller_spec.rb | 2 +- 12 files changed, 18 insertions(+), 18 deletions(-) diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e48b390be..bac7edc5a 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -1,6 +1,6 @@ class ApplicationController < ActionController::Base def render_not_found_html - render file: "#{Rails.root}/public/404.html", status: 404 + render file: Rails.root.join("public/404.html"), status: :not_found end def render_not_found_json(class_name, id) diff --git a/app/helpers/check_answers_helper.rb b/app/helpers/check_answers_helper.rb index 082ac4709..4c57974ed 100644 --- a/app/helpers/check_answers_helper.rb +++ b/app/helpers/check_answers_helper.rb @@ -1,6 +1,6 @@ -include GovukLinkHelper - module CheckAnswersHelper + include GovukLinkHelper + def display_answered_questions_summary(subsection, case_log) total = subsection.applicable_questions_count(case_log) answered = subsection.answered_questions_count(case_log) diff --git a/app/helpers/tasklist_helper.rb b/app/helpers/tasklist_helper.rb index d3dbca0b5..83b8d02e1 100644 --- a/app/helpers/tasklist_helper.rb +++ b/app/helpers/tasklist_helper.rb @@ -1,6 +1,6 @@ -include GovukLinkHelper - module TasklistHelper + include GovukLinkHelper + STATUSES = { not_started: "Not started", cannot_start_yet: "Cannot start yet", diff --git a/spec/controllers/case_logs_controller_spec.rb b/spec/controllers/case_logs_controller_spec.rb index 1f31b7e1c..43458e1b8 100644 --- a/spec/controllers/case_logs_controller_spec.rb +++ b/spec/controllers/case_logs_controller_spec.rb @@ -7,7 +7,7 @@ RSpec.describe CaseLogsController, type: :controller do FactoryBot.create( :case_log, owning_organisation: user.organisation, - managing_organisation: user.organisation + managing_organisation: user.organisation, ) end let(:id) { case_log.id } diff --git a/spec/features/form/check_answers_page_spec.rb b/spec/features/form/check_answers_page_spec.rb index 77641968b..236eaca2f 100644 --- a/spec/features/form/check_answers_page_spec.rb +++ b/spec/features/form/check_answers_page_spec.rb @@ -9,14 +9,14 @@ RSpec.describe "Form Check Answers Page" do :case_log, :in_progress, owning_organisation: user.organisation, - managing_organisation: user.organisation + managing_organisation: user.organisation, ) end let(:empty_case_log) do FactoryBot.create( :case_log, owning_organisation: user.organisation, - managing_organisation: user.organisation + managing_organisation: user.organisation, ) end let(:id) { case_log.id } diff --git a/spec/features/form/conditional_questions_spec.rb b/spec/features/form/conditional_questions_spec.rb index fca02ea78..3ab8b6f87 100644 --- a/spec/features/form/conditional_questions_spec.rb +++ b/spec/features/form/conditional_questions_spec.rb @@ -9,7 +9,7 @@ RSpec.describe "Form Conditional Questions" do :case_log, :in_progress, owning_organisation: user.organisation, - managing_organisation: user.organisation + managing_organisation: user.organisation, ) end let(:id) { case_log.id } diff --git a/spec/features/form/form_navigation_spec.rb b/spec/features/form/form_navigation_spec.rb index f36238405..965b46955 100644 --- a/spec/features/form/form_navigation_spec.rb +++ b/spec/features/form/form_navigation_spec.rb @@ -9,7 +9,7 @@ RSpec.describe "Form Navigation" do :case_log, :in_progress, owning_organisation: user.organisation, - managing_organisation: user.organisation + managing_organisation: user.organisation, ) end let(:id) { case_log.id } diff --git a/spec/features/form/page_routing_spec.rb b/spec/features/form/page_routing_spec.rb index 96ad0bde8..b508c860b 100644 --- a/spec/features/form/page_routing_spec.rb +++ b/spec/features/form/page_routing_spec.rb @@ -9,7 +9,7 @@ RSpec.describe "Form Page Routing" do :case_log, :in_progress, owning_organisation: user.organisation, - managing_organisation: user.organisation + managing_organisation: user.organisation, ) end let(:id) { case_log.id } diff --git a/spec/features/form/saving_data_spec.rb b/spec/features/form/saving_data_spec.rb index 2a9c6e3f9..e066c73eb 100644 --- a/spec/features/form/saving_data_spec.rb +++ b/spec/features/form/saving_data_spec.rb @@ -9,7 +9,7 @@ RSpec.describe "Form Saving Data" do :case_log, :in_progress, owning_organisation: user.organisation, - managing_organisation: user.organisation + managing_organisation: user.organisation, ) end let(:id) { case_log.id } diff --git a/spec/features/form/tasklist_page_spec.rb b/spec/features/form/tasklist_page_spec.rb index 70ba9e241..7ec4fce13 100644 --- a/spec/features/form/tasklist_page_spec.rb +++ b/spec/features/form/tasklist_page_spec.rb @@ -9,14 +9,14 @@ RSpec.describe "Task List" do :case_log, :in_progress, owning_organisation: user.organisation, - managing_organisation: user.organisation + managing_organisation: user.organisation, ) end let(:empty_case_log) do FactoryBot.create( :case_log, owning_organisation: user.organisation, - managing_organisation: user.organisation + managing_organisation: user.organisation, ) end let(:id) { case_log.id } diff --git a/spec/features/form/validations_spec.rb b/spec/features/form/validations_spec.rb index 65ba8abe7..2721dcef9 100644 --- a/spec/features/form/validations_spec.rb +++ b/spec/features/form/validations_spec.rb @@ -9,14 +9,14 @@ RSpec.describe "validations" do :case_log, :in_progress, owning_organisation: user.organisation, - managing_organisation: user.organisation + managing_organisation: user.organisation, ) end let(:empty_case_log) do FactoryBot.create( :case_log, owning_organisation: user.organisation, - managing_organisation: user.organisation + managing_organisation: user.organisation, ) end let(:id) { case_log.id } @@ -106,7 +106,7 @@ RSpec.describe "validations" do :in_progress, ecstat1: "Full-time - 30 hours or more", owning_organisation: user.organisation, - managing_organisation: user.organisation + managing_organisation: user.organisation, ) end let(:income_over_soft_limit) { 750 } diff --git a/spec/requests/case_log_controller_spec.rb b/spec/requests/case_log_controller_spec.rb index 6cfa61fc6..aab5b02a9 100644 --- a/spec/requests/case_log_controller_spec.rb +++ b/spec/requests/case_log_controller_spec.rb @@ -188,7 +188,7 @@ RSpec.describe CaseLogsController, type: :request do it "shows the tasklist for case logs you have access to" do expect(response.body).to match("Tasklist for log") - expect(response.body).to match("#{case_log.id}") + expect(response.body).to match(case_log.id.to_s) end end