[#10799] Add test
This commit is contained in:
parent
64297f9ee8
commit
687617cb08
3 changed files with 5 additions and 3 deletions
|
@ -11,4 +11,4 @@
|
||||||
%p
|
%p
|
||||||
Votre jeton API Entreprise expirera le
|
Votre jeton API Entreprise expirera le
|
||||||
= procedure.api_entreprise_token_expires_at.strftime('%d/%m/%Y à %H:%M.')
|
= procedure.api_entreprise_token_expires_at.strftime('%d/%m/%Y à %H:%M.')
|
||||||
Merci de le renouveler avant cette date.
|
Merci de le renouveler avant cette date.
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
propre à votre démarche.
|
propre à votre démarche.
|
||||||
|
|
||||||
= render partial: 'administrateurs/procedures/api_entreprise_token_expiration_alert', locals: { procedure: @procedure }
|
= render partial: 'administrateurs/procedures/api_entreprise_token_expiration_alert', locals: { procedure: @procedure }
|
||||||
|
|
||||||
.fr-input-group
|
.fr-input-group
|
||||||
= f.label :api_entreprise_token, "Jeton", class: 'fr-label'
|
= f.label :api_entreprise_token, "Jeton", class: 'fr-label'
|
||||||
= f.password_field :api_entreprise_token, value: @procedure.read_attribute(:api_entreprise_token), class: 'fr-input'
|
= f.password_field :api_entreprise_token, value: @procedure.read_attribute(:api_entreprise_token), class: 'fr-input'
|
||||||
|
|
|
@ -83,7 +83,8 @@ describe Procedure::ErrorsSummary, type: :component do
|
||||||
include Logic
|
include Logic
|
||||||
|
|
||||||
let(:validation_context) { :publication }
|
let(:validation_context) { :publication }
|
||||||
let(:procedure) { create(:procedure, attestation_template:, initiated_mail:) }
|
let(:expired_token) { JWT.encode({ exp: 2.days.ago.to_i }, nil, 'none') }
|
||||||
|
let(:procedure) { create(:procedure, attestation_template:, initiated_mail:, api_entreprise_token: expired_token) }
|
||||||
let(:attestation_template) { build(:attestation_template) }
|
let(:attestation_template) { build(:attestation_template) }
|
||||||
let(:initiated_mail) { build(:initiated_mail) }
|
let(:initiated_mail) { build(:initiated_mail) }
|
||||||
|
|
||||||
|
@ -97,6 +98,7 @@ describe Procedure::ErrorsSummary, type: :component do
|
||||||
expect(page).to have_selector("a", text: "Les règles d’inéligibilité")
|
expect(page).to have_selector("a", text: "Les règles d’inéligibilité")
|
||||||
expect(page).to have_selector("a", text: "Le modèle d’attestation")
|
expect(page).to have_selector("a", text: "Le modèle d’attestation")
|
||||||
expect(page).to have_selector("a", text: "L’email de notification de passage de dossier en instruction")
|
expect(page).to have_selector("a", text: "L’email de notification de passage de dossier en instruction")
|
||||||
|
expect(page).to have_selector("a", text: "Jeton API Entreprise")
|
||||||
expect(page).to have_text("n'est pas valide", count: 2)
|
expect(page).to have_text("n'est pas valide", count: 2)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue