From 10507fa5a8cd61edfcde3072642a96f16582a468 Mon Sep 17 00:00:00 2001 From: Dushan Despotovic Date: Thu, 28 Apr 2022 16:40:43 +0100 Subject: [PATCH] lint fixes --- app/controllers/case_logs_controller.rb | 3 +-- spec/factories/user.rb | 2 +- spec/models/case_log_spec.rb | 1 - spec/services/imports/case_logs_import_service_spec.rb | 6 +++--- 4 files changed, 5 insertions(+), 7 deletions(-) diff --git a/app/controllers/case_logs_controller.rb b/app/controllers/case_logs_controller.rb index cde7ad501..e3c6f5b43 100644 --- a/app/controllers/case_logs_controller.rb +++ b/app/controllers/case_logs_controller.rb @@ -104,12 +104,11 @@ private { "owning_organisation_id" => current_user.organisation.id, "managing_organisation_id" => current_user.organisation.id, - "created_by_id" => current_user.id + "created_by_id" => current_user.id, } end def api_case_log_params - return {} unless params[:case_log] permitted = params.require(:case_log).permit(CaseLog.editable_fields) diff --git a/spec/factories/user.rb b/spec/factories/user.rb index b62006a97..f5d9e7769 100644 --- a/spec/factories/user.rb +++ b/spec/factories/user.rb @@ -4,7 +4,7 @@ FactoryBot.define do name { "Danny Rojas" } password { "pAssword1" } organisation - role { "data_provider" } + role { "data_provider" } old_user_id { 2 } trait :data_coordinator do role { "data_coordinator" } diff --git a/spec/models/case_log_spec.rb b/spec/models/case_log_spec.rb index e5f9af085..8c483774c 100644 --- a/spec/models/case_log_spec.rb +++ b/spec/models/case_log_spec.rb @@ -1852,7 +1852,6 @@ RSpec.describe CaseLog do end context "when filtering by user" do - before do PaperTrail::Version.find_by(item_id: case_log_1.id, event: "create").update!(whodunnit: created_by_user.to_global_id.uri.to_s) PaperTrail::Version.find_by(item_id: case_log_2.id, event: "create").update!(whodunnit: created_by_user.to_global_id.uri.to_s) diff --git a/spec/services/imports/case_logs_import_service_spec.rb b/spec/services/imports/case_logs_import_service_spec.rb index 92ee96d3f..d02c60aee 100644 --- a/spec/services/imports/case_logs_import_service_spec.rb +++ b/spec/services/imports/case_logs_import_service_spec.rb @@ -31,9 +31,9 @@ RSpec.describe Imports::CaseLogsImportService do WebMock.stub_request(:get, /api.postcodes.io\/postcodes\/LS166FT/) .to_return(status: 200, body: '{"status":200,"result":{"codes":{"admin_district":"E08000035"}}}', headers: {}) - - FactoryBot.create(:user, old_user_id: "c3061a2e6ea0b702e6f6210d5c52d2a92612d2aa" ) - FactoryBot.create(:user, old_user_id: "e29c492473446dca4d50224f2bb7cf965a261d6f" ) + + FactoryBot.create(:user, old_user_id: "c3061a2e6ea0b702e6f6210d5c52d2a92612d2aa") + FactoryBot.create(:user, old_user_id: "e29c492473446dca4d50224f2bb7cf965a261d6f") end it "successfully create all case logs" do