poc(batch_operations_controller): implement simple [not yet with procedure_presentation] action to create a batch operation
This commit is contained in:
parent
b11dbafc59
commit
7df86c50fb
8 changed files with 99 additions and 8 deletions
|
@ -1,12 +1,16 @@
|
|||
FactoryBot.define do
|
||||
factory :batch_operation do
|
||||
transient do
|
||||
invalid_instructeur { nil }
|
||||
end
|
||||
trait :archiver do
|
||||
operation { BatchOperation.operations.fetch(:archiver) }
|
||||
dossiers do
|
||||
[
|
||||
association(:dossier, :accepte),
|
||||
association(:dossier, :refuse),
|
||||
association(:dossier, :sans_suite)
|
||||
after(:build) do |batch_operation, _evaluator|
|
||||
procedure = create(:procedure, instructeurs: [_evaluator.invalid_instructeur.presence || batch_operation.instructeur])
|
||||
batch_operation.dossiers = [
|
||||
build(:dossier, :accepte, procedure: procedure),
|
||||
build(:dossier, :refuse, procedure: procedure),
|
||||
build(:dossier, :sans_suite, procedure: procedure)
|
||||
]
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue