feat(expert.signup): dsfrize
This commit is contained in:
parent
0b3a0d5840
commit
e788846894
2 changed files with 14 additions and 10 deletions
|
@ -1,16 +1,20 @@
|
||||||
.two-columns.avis-sign-up
|
.two-columns.avis-sign-up
|
||||||
.columns-container
|
.columns-container
|
||||||
.column.left
|
.column.left
|
||||||
%p.description= @dossier.procedure.libelle
|
%h2.fr-py-5w.text-center= @dossier.procedure.libelle
|
||||||
%p.dossier Dossier nº #{@dossier.id}
|
%p.dossier Dossier nº #{@dossier.id}
|
||||||
.column
|
.column
|
||||||
= form_for(User.new, url: sign_up_expert_avis_path(email: @email), method: :post, html: { class: "form" }) do |f|
|
= form_for(User.new(email: @email), url: sign_up_expert_avis_path(email: @email), method: :post, html: { class: "fr-py-5w" }) do |f|
|
||||||
%h1 Créez-vous un compte
|
%h1.fr-h2= t('views.registrations.new.title', name: APPLICATION_NAME)
|
||||||
|
%fieldset.fr-mb-0.fr-fieldset{ aria: { labelledby: 'create-account-legend' } }
|
||||||
|
.fr-fieldset__element
|
||||||
|
%p.fr-text--sm= t('utils.mandatory_champs')
|
||||||
|
|
||||||
= f.label :email, "Email"
|
.fr-fieldset__element= render Dsfr::InputComponent.new(form: f, attribute: :email, input_type: :email_field, opts: { disabled: true, autocomplete: 'email' })
|
||||||
= f.email_field :email, value: @email, disabled: true
|
.fr-fieldset__element
|
||||||
|
= render Dsfr::InputComponent.new(form: f, attribute: :password, input_type: :password_field, opts: { autocomplete: 'new-password', minlength: PASSWORD_MIN_LENGTH }) do |c|
|
||||||
|
- c.with_describedby do
|
||||||
|
= render partial: "devise/password_rules", locals: { id: c.describedby_id }
|
||||||
|
|
||||||
= f.label :password, "Mot de passe"
|
%ul.fr-btns-group
|
||||||
= f.password_field :password, required: true, placeholder: "#{PASSWORD_MIN_LENGTH} caractères minimum"
|
%li= f.submit t('views.shared.account.create'), class: "fr-btn"
|
||||||
|
|
||||||
= f.submit "Créer un compte", class: "button large primary expand"
|
|
||||||
|
|
|
@ -20,7 +20,7 @@ describe 'Inviting an expert:' do
|
||||||
before 'Signing up' do
|
before 'Signing up' do
|
||||||
visit sign_up_expert_avis_path(avis.dossier.procedure, avis, email: avis.expert.email)
|
visit sign_up_expert_avis_path(avis.dossier.procedure, avis, email: avis.expert.email)
|
||||||
|
|
||||||
expect(page).to have_field('Email', with: avis.expert.email, disabled: true)
|
expect(page).to have_field('Adresse électronique', with: avis.expert.email, disabled: true)
|
||||||
fill_in 'Mot de passe', with: password
|
fill_in 'Mot de passe', with: password
|
||||||
click_on 'Créer un compte'
|
click_on 'Créer un compte'
|
||||||
end
|
end
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue