feat(spec.procedure_administrateurs_spec): les navigation and cases
This commit is contained in:
parent
45814fdbfb
commit
f98517852f
1 changed files with 6 additions and 15 deletions
|
@ -11,26 +11,17 @@ describe 'Administrateurs can manage administrateurs', js: true do
|
||||||
login_as administrateur.user, scope: :user
|
login_as administrateur.user, scope: :user
|
||||||
end
|
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)
|
visit admin_procedure_path(procedure)
|
||||||
find('#administrateurs').click
|
find('#administrateurs').click
|
||||||
expect(page).to have_css("h1", text: "Administrateurs")
|
expect(page).to have_css("h1", text: "Administrateurs")
|
||||||
end
|
|
||||||
|
|
||||||
context 'as admin not flagged from manager' do
|
fill_in('administrateur_email', with: another_administrateur.email)
|
||||||
let(:manager) { false }
|
|
||||||
|
|
||||||
scenario 'the administrator can add another administrator' do
|
click_on 'Ajouter comme administrateur'
|
||||||
another_administrateur = create(:administrateur)
|
within('.alert-success') do
|
||||||
visit admin_procedure_administrateurs_path(procedure)
|
expect(page).to have_content(another_administrateur.email)
|
||||||
|
|
||||||
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue