feat(attestation): already published without publication when procedure is draft

This commit is contained in:
Colin Darie 2024-06-06 14:48:50 +02:00
parent 5bda9d0c63
commit ce998f7864
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
4 changed files with 82 additions and 14 deletions

View file

@ -71,6 +71,13 @@ describe 'As an administrateur, I want to manage the procedures attestation',
end
context 'Update attestation v2' do
let(:procedure) do
create(:procedure, :published,
administrateurs: [administrateur],
libelle: 'libellé de la procédure',
path: 'libelle-de-la-procedure')
end
before do
Flipper.enable(:attestation_v2)
@ -100,7 +107,7 @@ describe 'As an administrateur, I want to manage the procedures attestation',
attestation.present?
}
expect(attestation.label_logo).to eq("System Test")
expect(attestation.activated?).to be_falsey
expect(attestation.activated?).to be_truthy
expect(page).to have_content("Formulaire enregistré")
click_on "date de décision"
@ -139,6 +146,12 @@ describe 'As an administrateur, I want to manage the procedures attestation',
click_on "Publier"
expect(attestation.reload).to be_published
expect(page).to have_text("Lattestation a été publiée")
fill_in "Intitulé de la direction", with: "plop"
click_on "Publier les modifications"
expect(procedure.reload.attestation_template.label_direction).to eq("plop")
expect(page).to have_text(/La nouvelle version de lattestation/)
end
context "tag in error" do