fix(fork): don't fail when user submit twice en_construction (from 2 tabs)

This commit is contained in:
Colin Darie 2023-05-11 16:52:10 +02:00
parent d3028f5570
commit 059dabb5ac
4 changed files with 23 additions and 1 deletions

View file

@ -512,6 +512,17 @@ describe Users::DossiersController, type: :controller do
expect(response).to redirect_to(dossier_path(dossier))
end
end
context 'when dossier was already submitted' do
before { post :submit_en_construction, params: payload }
it 'redirects to the dossier' do
subject
expect(response).to redirect_to(dossier_path(dossier))
expect(flash.alert).to eq("Les modifications ont déjà été déposées")
end
end
end
describe '#update brouillon' do