feat(spec.procedure_administrateurs_spec): les navigation and cases

This commit is contained in:
mfo 2024-05-31 08:20:45 +02:00
parent 45814fdbfb
commit f98517852f

View file

@ -11,28 +11,19 @@ describe 'Administrateurs can manage administrateurs', js: true do
login_as administrateur.user, scope: :user
end
scenario 'card is clickable' do
scenario "card is clickable, and i can send invitation when i'm not a manager" do
another_administrateur = create(:administrateur)
visit admin_procedure_path(procedure)
find('#administrateurs').click
expect(page).to have_css("h1", text: "Administrateurs")
end
context 'as admin not flagged from manager' do
let(:manager) { false }
scenario 'the administrator can add another administrator' do
another_administrateur = create(:administrateur)
visit admin_procedure_administrateurs_path(procedure)
fill_in('administrateur_email', with: another_administrateur.email)
click_on 'Ajouter comme administrateur'
within('.alert-success') do
expect(page).to have_content(another_administrateur.email)
end
end
end
context 'as admin flagged from manager' do
let(:manager) { true }