Browse Source

Rubocop

pull/114/head
baarkerlounger 4 years ago
parent
commit
e159373b11
  1. 2
      app/controllers/application_controller.rb
  2. 4
      app/helpers/check_answers_helper.rb
  3. 4
      app/helpers/tasklist_helper.rb
  4. 2
      spec/controllers/case_logs_controller_spec.rb
  5. 4
      spec/features/form/check_answers_page_spec.rb
  6. 2
      spec/features/form/conditional_questions_spec.rb
  7. 2
      spec/features/form/form_navigation_spec.rb
  8. 2
      spec/features/form/page_routing_spec.rb
  9. 2
      spec/features/form/saving_data_spec.rb
  10. 4
      spec/features/form/tasklist_page_spec.rb
  11. 6
      spec/features/form/validations_spec.rb
  12. 2
      spec/requests/case_log_controller_spec.rb

2
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)

4
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)

4
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",

2
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 }

4
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 }

2
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 }

2
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 }

2
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 }

2
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 }

4
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 }

6
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 }

2
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

Loading…
Cancel
Save