fix(contact): drop piece jointe not file

This commit is contained in:
Colin Darie 2024-11-19 16:29:19 +01:00
parent 5a2ab37049
commit e52aae420a
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
4 changed files with 23 additions and 0 deletions

View file

@ -198,6 +198,16 @@ describe ContactController, question_type: :controller do
expect(response.body).to include("un message")
end
end
context "with an invalid attachment type" do
let(:params) { super().merge(piece_jointe: "not_a_file") }
it "returns unprocessable entity status" do
subject
expect(response).to have_http_status(:unprocessable_entity)
expect(response.body).to include("La pièce jointe doit être un fichier")
end
end
end
end