Add a missing test
This commit is contained in:
parent
28f2ec1d86
commit
0ec3855f8d
1 changed files with 5 additions and 1 deletions
|
@ -26,12 +26,15 @@ RSpec.describe AutoArchiveProcedureWorker, type: :worker do
|
||||||
let!(:dossier6) { create(:dossier, procedure: procedure_hier, state: 'closed', archived: false)}
|
let!(:dossier6) { create(:dossier, procedure: procedure_hier, state: 'closed', archived: false)}
|
||||||
let!(:dossier7) { create(:dossier, procedure: procedure_hier, state: 'refused', archived: false)}
|
let!(:dossier7) { create(:dossier, procedure: procedure_hier, state: 'refused', archived: false)}
|
||||||
let!(:dossier8) { create(:dossier, procedure: procedure_hier, state: 'without_continuation', archived: false)}
|
let!(:dossier8) { create(:dossier, procedure: procedure_hier, state: 'without_continuation', archived: false)}
|
||||||
|
let!(:dossier9) { create(:dossier, procedure: procedure_aujourdhui, state: 'initiated', archived: false)}
|
||||||
|
|
||||||
before do
|
before do
|
||||||
subject
|
subject
|
||||||
(1..8).each do |i|
|
|
||||||
|
(1..9).each do |i|
|
||||||
eval "dossier#{i}.reload"
|
eval "dossier#{i}.reload"
|
||||||
end
|
end
|
||||||
|
|
||||||
procedure_hier.reload
|
procedure_hier.reload
|
||||||
procedure_aujourdhui.reload
|
procedure_aujourdhui.reload
|
||||||
end
|
end
|
||||||
|
@ -44,6 +47,7 @@ RSpec.describe AutoArchiveProcedureWorker, type: :worker do
|
||||||
it { expect(dossier6.state).to eq 'closed' }
|
it { expect(dossier6.state).to eq 'closed' }
|
||||||
it { expect(dossier7.state).to eq 'refused' }
|
it { expect(dossier7.state).to eq 'refused' }
|
||||||
it { expect(dossier8.state).to eq 'without_continuation' }
|
it { expect(dossier8.state).to eq 'without_continuation' }
|
||||||
|
it { expect(dossier9.state).to eq 'received' }
|
||||||
|
|
||||||
it { expect(procedure_hier.archived).to eq true }
|
it { expect(procedure_hier.archived).to eq true }
|
||||||
it { expect(procedure_aujourdhui.archived).to eq true }
|
it { expect(procedure_aujourdhui.archived).to eq true }
|
||||||
|
|
Loading…
Reference in a new issue