Skip to content

Commit

Permalink
Add statuses traits
Browse files Browse the repository at this point in the history
This updates the existing traits for the factories to encorporate the
new statuses column.
  • Loading branch information
thomasleese committed Sep 27, 2023
1 parent e35d379 commit 2b14b65
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions spec/factories/application_forms.rb
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@
trait :submitted do
not_started_stage
status { "submitted" }
statuses { %w[assessment_not_started] }
submitted_at { Time.zone.now }
working_days_since_submission { 0 }

Expand All @@ -200,63 +201,94 @@
pre_assessment_stage
requires_preliminary_check { true }
status { "preliminary_check" }
statuses { %w[preliminary_check] }
end

trait :assessment_in_progress do
submitted
assessment_stage
status { "assessment_in_progress" }
statuses { %w[assessment_in_progress] }
end

trait :waiting_on do
submitted
action_required_by_external
verification_stage
status { "waiting_on" }
statuses do
%w[
waiting_on_further_information
waiting_on_lops
waiting_on_qualification
waiting_on_reference
]
end
end

trait :received do
submitted
verification_stage
status { "received" }
statuses do
%w[
received_further_information
received_lops
received_qualification
received_reference
]
end
end

trait :overdue do
submitted
verification_stage
status { "overdue" }
statuses do
%w[
overdue_further_information
overdue_lops
overdue_qualification
overdue_reference
]
end
end

trait :awarded_pending_checks do
submitted
review_stage
status { "awarded_pending_checks" }
statuses { %w[awarded_pending_checks] }
end

trait :potential_duplicate_in_dqt do
submitted
review_stage
status { "potential_duplicate_in_dqt" }
statuses { %w[potential_duplicate_in_dqt] }
end

trait :awarded do
submitted
completed_stage
status { "awarded" }
statuses { %w[awarded] }
awarded_at { Time.zone.now }
end

trait :declined do
submitted
completed_stage
status { "declined" }
statuses { %w[declined] }
declined_at { Time.zone.now }
end

trait :withdrawn do
submitted
completed_stage
status { "withdrawn" }
statuses { %w[withdrawn] }
withdrawn_at { Time.zone.now }
end

Expand Down

0 comments on commit 2b14b65

Please sign in to comment.