Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Factories data inconsistency #2382

Open
lostie opened this issue May 25, 2018 · 0 comments
Open

Factories data inconsistency #2382

lostie opened this issue May 25, 2018 · 0 comments

Comments

@lostie
Copy link
Contributor

lostie commented May 25, 2018

Ideally factories/traits would reflect valid data that we can rely on our tests. Currently we have setup a lot of factories just to fill in some specific spec needs (not guarantying the record is actually valid). This issue is exposed further more since the AGFS fee reform release and the split of the claim submission steps.

We should also considering having data validity for claims for each submission steps and for each stages (e.g draft, submitted, allocated). A lot of the data was "valid" until now mainly because the claim was set with a default "form_step" that required very little data. As an example of why that's an issue, creating a factory claim with state submitted (which is supposed to contain ALL the data required for that claim) was being created without any validations errors, since the only checks it was performing were related with the case details step.

Not exhaustively here's a list of some of them that are not considered valid by FactoryBot itself:

FactoryBot::InvalidFactoryError: The following factories are invalid:

* assessment - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* case_worker_claim - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* certification - undefined method `created_at' for nil:NilClass (NoMethodError)
* claim - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* unpersisted_claim - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* invalid_claim - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* draft_claim - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* allocated_claim - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* archived_pending_delete_claim - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* authorised_claim - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* redetermination_claim - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* awaiting_written_reasons_claim - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* part_authorised_claim - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* refused_claim - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* rejected_claim - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* submitted_claim - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* deterministic_claim - OffenceClass(#70208327958620) expected, got TrueClass(#70208245388120) (ActiveRecord::AssociationTypeMismatch)
* date_attended - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* single_date_attended - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* same_date_attended_to_as_from - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* date_range_attended - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* defendant - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* disbursement - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* document_type_claim - uninitialized constant DocumentTypeClaim (NameError)
* document_type - uninitialized constant DocumentType (NameError)
* document - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* expense - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* transfer_fee_type - Validation failed: Description Fee type description must be unique (ActiveRecord::RecordInvalid)
* fixed_fee - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* misc_fee - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* warrant_fee - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* basic_fee - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* graduated_fee - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* injection_attempt - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* message - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* unpersisted_message - Validation failed: Claim Message claim_id cannot be blank (ActiveRecord::RecordInvalid)
* redetermination - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
* user_message_status - There is no VAT rate for date 25/05/2018 (VatRate::MissingVatRateError)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant