Browse Source

lint fixes

pull/528/head
Dushan Despotovic 3 years ago
parent
commit
10507fa5a8
  1. 3
      app/controllers/case_logs_controller.rb
  2. 2
      spec/factories/user.rb
  3. 1
      spec/models/case_log_spec.rb
  4. 6
      spec/services/imports/case_logs_import_service_spec.rb

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

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

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

6
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

Loading…
Cancel
Save