Skip to content

Commit

Permalink
Linting & cleans up 526 factory
Browse files Browse the repository at this point in the history
  • Loading branch information
stiehlrod committed Oct 8, 2024
1 parent 11f3635 commit a958355
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 42 deletions.
4 changes: 2 additions & 2 deletions modules/claims_api/app/sidekiq/claims_api/reporting_base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ def make_claims

FactoryBot.create(:auto_established_claim_va_gov, created_at: Time.zone.now)
FactoryBot.create(:auto_established_claim_va_gov, created_at: Time.zone.now)
FactoryBot.create(:auto_established_claim_va_gov, :set_transaction_id, created_at: Time.zone.now)
FactoryBot.create(:auto_established_claim_va_gov, :set_transaction_id, created_at: Time.zone.now)
FactoryBot.create(:auto_established_claim_va_gov, :transaction_id_25, created_at: Time.zone.now)

Check failure on line 171 in modules/claims_api/app/sidekiq/claims_api/reporting_base.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Naming/VariableNumber: Use normalcase for symbol numbers.
FactoryBot.create(:auto_established_claim_va_gov, :transaction_id_25, created_at: Time.zone.now)

Check failure on line 172 in modules/claims_api/app/sidekiq/claims_api/reporting_base.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Naming/VariableNumber: Use normalcase for symbol numbers.

FactoryBot.create(:auto_established_claim_v2, status: 'errored')
FactoryBot.create(:auto_established_claim_v2, status: 'pending')
Expand Down
30 changes: 4 additions & 26 deletions modules/claims_api/spec/factories/auto_established_claims.rb
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@
status { ClaimsApi::AutoEstablishedClaim::ERRORED }
end

trait :set_transaction_id do
trait :transaction_id_25 do

Check failure on line 80 in modules/claims_api/spec/factories/auto_established_claims.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Naming/VariableNumber: Use normalcase for symbol numbers.
transaction_id { '25' }
end

Expand All @@ -99,31 +99,9 @@
status { ClaimsApi::AutoEstablishedClaim::ERRORED }
end

trait :set_transaction_id do
transaction_id { '25' }
end

factory :auto_established_claim_without_flashes_or_special_issues, class: 'ClaimsApi::AutoEstablishedClaim' do
id { SecureRandom.uuid }
status { 'pending' }
source { 'oddball' }
cid {
%w[0oa9uf05lgXYk6ZXn297 0oa66qzxiq37neilh297 0oadnb0o063rsPupH297 0oadnb1x4blVaQ5iY297
0oadnavva9u5F6vRz297 0oagdm49ygCSJTp8X297 0oaqzbqj9wGOCJBG8297 0oao7p92peuKEvQ73297].sample
}
evss_id { nil }
auth_headers { { test: ('a'..'z').to_a.shuffle.join } }
form_data do
json = JSON.parse(File
.read(::Rails.root.join(*'/modules/claims_api/spec/fixtures/form_526_no_flashes_no_special_issues.json'.split('/')).to_s))
json['data']['attributes']
end
# rubocop:enable Layout/LineLength

trait :status_errored do
status { 'errored' }
evss_response { 'something' }
end
trait :status_errored do
status { 'errored' }
evss_response { 'something' }
end

factory :auto_established_claim_with_auth_headers, class: 'ClaimsApi::AutoEstablishedClaim' do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@
with_settings(Settings.claims_api, report_enabled: true) do
create(:auto_established_claim_va_gov, created_at: Time.zone.now).freeze
create(:auto_established_claim_va_gov, created_at: Time.zone.now).freeze
create(:auto_established_claim_va_gov, :set_transaction_id, created_at: Time.zone.now).freeze
create(:auto_established_claim_va_gov, :set_transaction_id, created_at: Time.zone.now).freeze
create(:auto_established_claim_va_gov, :transaction_id_25, created_at: Time.zone.now).freeze

Check failure on line 65 in modules/claims_api/spec/sidekiq/shared_reporting_examples_spec.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Naming/VariableNumber: Use normalcase for symbol numbers.
create(:auto_established_claim_va_gov, :transaction_id_25, created_at: Time.zone.now).freeze

Check failure on line 66 in modules/claims_api/spec/sidekiq/shared_reporting_examples_spec.rb

View workflow job for this annotation

GitHub Actions / Linting and Security

Naming/VariableNumber: Use normalcase for symbol numbers.

job = described_class.new
job.perform
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# frozen_string_literal: true

require './modules/claims_api/app/sidekiq/claims_api/reporting_base'

class ClaimsApiUnsuccessfulReportMailerPreview < ActionMailer::Preview
Expand Down Expand Up @@ -45,15 +46,15 @@ def unsuccessful_va_gov_claims_submissions
def claims_totals
[
{ 'consumer 1' => { pending: 2,
errored: 1,
totals: 3,
percentage_with_flashes: '50.0%',
percentage_with_special_issues: '50.0%' } },
errored: 1,
totals: 3,
percentage_with_flashes: '50.0%',
percentage_with_special_issues: '50.0%' } },
{ 'consumer 2' => { pending: 3,
errored: 3,
totals: 6,
percentage_with_flashes: '50.0%',
percentage_with_special_issues: '50.0%' } }
errored: 3,
totals: 6,
percentage_with_flashes: '50.0%',
percentage_with_special_issues: '50.0%' } }
]
# reporting_base.claims_totals
end
Expand All @@ -67,7 +68,7 @@ def poa_totals
'consumer 2' => { totals: 8, updated: 3, errored: 2, pending: 1, uploaded: 2 }
}
]

# reporting_base.poa_totals
end

Expand All @@ -76,7 +77,6 @@ def unsuccessful_poa_submissions
end

def ews_totals

[
{
'consumer 1' => { totals: 10, updated: 5, errored: 2, pending: 1, uploaded: 2 }
Expand All @@ -103,8 +103,6 @@ def itf_totals
]
end

private

def reporting_base
ClaimsApi::ReportingBase.new
end
Expand Down

0 comments on commit a958355

Please sign in to comment.