Add authorized content type for pj
This commit is contained in:
parent
ea1b7ff129
commit
d72f0c6dd2
3 changed files with 95 additions and 0 deletions
|
@ -22,6 +22,7 @@ describe Champs::PieceJustificativeChamp do
|
|||
|
||||
context "by default" do
|
||||
it { is_expected.to validate_size_of(:piece_justificative_file).less_than(Champs::PieceJustificativeChamp::MAX_SIZE) }
|
||||
it { is_expected.to validate_content_type_of(:piece_justificative_file).rejecting('application/x-ms-dos-executable') }
|
||||
it { expect(champ_pj.type_de_champ.skip_pj_validation).to be_falsy }
|
||||
end
|
||||
|
||||
|
@ -30,6 +31,12 @@ describe Champs::PieceJustificativeChamp do
|
|||
|
||||
it { is_expected.not_to validate_size_of(:piece_justificative_file).less_than(Champs::PieceJustificativeChamp::MAX_SIZE) }
|
||||
end
|
||||
|
||||
context "when content-type validation is disabled" do
|
||||
before { champ_pj.type_de_champ.update(skip_content_type_pj_validation: true) }
|
||||
|
||||
it { is_expected.not_to validate_content_type_of(:piece_justificative_file).rejecting('application/x-ms-dos-executable') }
|
||||
end
|
||||
end
|
||||
|
||||
describe "#for_export" do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue