add admin creation spec
This commit is contained in:
parent
e360112753
commit
f7528f70ac
1 changed files with 24 additions and 0 deletions
24
spec/features/admin/admin_creation_spec.rb
Normal file
24
spec/features/admin/admin_creation_spec.rb
Normal file
|
@ -0,0 +1,24 @@
|
|||
require 'spec_helper'
|
||||
|
||||
feature 'As an administrateur', js: true do
|
||||
let(:administration) { create(:administration) }
|
||||
let(:admin_email) { 'new_admin@gouv.fr' }
|
||||
|
||||
before do
|
||||
perform_enqueued_jobs do
|
||||
administration.invite_admin(admin_email)
|
||||
end
|
||||
end
|
||||
|
||||
scenario 'I can register' do
|
||||
confirmation_email = open_email(admin_email)
|
||||
token_params = confirmation_email.body.match(/token=[^"]+/)
|
||||
|
||||
visit "admin/activate?#{token_params}"
|
||||
fill_in :administrateur_password, with: 'démarches-simplifiées-pwd'
|
||||
|
||||
click_button 'Continuer'
|
||||
|
||||
expect(page).to have_content 'Mot de passe enregistré'
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue