change banner for admin
This commit is contained in:
parent
9040d9407d
commit
cf99b30349
5 changed files with 87 additions and 5 deletions
|
@ -180,3 +180,8 @@ div.pagination {
|
|||
#confirm {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.fa {
|
||||
width: 15px;
|
||||
text-align: center;
|
||||
}
|
21
app/views/administrateurs/_login_banner.html.haml
Normal file
21
app/views/administrateurs/_login_banner.html.haml
Normal file
|
@ -0,0 +1,21 @@
|
|||
%div{ style: "decorate:none; display: flex;box-shadow:none; float:right; display: flex" }
|
||||
%div{ style: "vertical-align: middle; margin-right: 10px; margin-top: auto; margin-bottom: auto;" }
|
||||
mps-test@apientreprise.fr
|
||||
.dropdown#admin_menu
|
||||
%button.btn.btn-default.dropdown-toggle#dropdownMenuAdmin{ type: :button, 'data-toggle' => 'dropdown', 'aria-haspopup' => true, 'aria-expanded' => false}
|
||||
%i.fa.fa-cog
|
||||
%span.caret
|
||||
%ul.dropdown-menu.dropdown-menu-right
|
||||
%li
|
||||
= link_to(admin_procedures_path, id: :menu_item_procedure) do
|
||||
%i.fa.fa-list{ style: "background-size: 10px;"}
|
||||
Procédures
|
||||
%li
|
||||
= link_to(admin_profile_path, id: :profile) do
|
||||
%i.fa.fa-user
|
||||
Profile
|
||||
%li.divider{ role: :separator}
|
||||
%li
|
||||
= link_to('/administrateurs/sign_out',id: :admin_sign_out, method: :delete) do
|
||||
%i.fa.fa-power-off
|
||||
Se déconnecter
|
|
@ -1,7 +1,7 @@
|
|||
#form_login
|
||||
= image_tag('logo-tps.png')
|
||||
%br
|
||||
%h2#login_user Administration
|
||||
%h2#login_admin Administration
|
||||
|
||||
%br
|
||||
%br
|
||||
|
|
|
@ -22,10 +22,7 @@
|
|||
= current_gestionnaire.email
|
||||
= link_to "Déconnexion", '/gestionnaires/sign_out', method: :delete, :class => 'btn btn-md'
|
||||
-elsif administrateur_signed_in?
|
||||
%div
|
||||
= current_administrateur.email
|
||||
= link_to "Déconnexion", '/administrateurs/sign_out', method: :delete, :class => 'btn btn-md'
|
||||
|
||||
= render partial: 'administrateurs/login_banner'
|
||||
- elsif user_signed_in?
|
||||
%div.user
|
||||
-if current_user.loged_in_with_france_connect
|
||||
|
|
59
spec/features/admin/connection_spec.rb
Normal file
59
spec/features/admin/connection_spec.rb
Normal file
|
@ -0,0 +1,59 @@
|
|||
require 'spec_helper'
|
||||
|
||||
feature 'Administrator connection' do
|
||||
let(:admin) { create(:administrateur) }
|
||||
before do
|
||||
visit new_administrateur_session_path
|
||||
end
|
||||
scenario 'administrator is on admin loggin page' do
|
||||
expect(page).to have_css('#login_admin')
|
||||
end
|
||||
|
||||
context "admin fills form and log in" do
|
||||
before do
|
||||
page.find_by_id('administrateur_email').set admin.email
|
||||
page.find_by_id('administrateur_password').set admin.password
|
||||
page.click_on 'Se connecter'
|
||||
end
|
||||
scenario 'a menu button is available' do
|
||||
expect(page).to have_css('#admin_menu')
|
||||
end
|
||||
|
||||
context 'when he click on the menu' do
|
||||
before do
|
||||
page.find_by_id('admin_menu').click
|
||||
end
|
||||
scenario 'it displays the menu' do
|
||||
expect(page).to have_css('a#profile')
|
||||
expect(page).to have_css('a#admin_sign_out')
|
||||
end
|
||||
context 'when clicking on sign_out' do
|
||||
before do
|
||||
page.find_by_id('admin_sign_out').click
|
||||
end
|
||||
scenario 'admin is redireted to home page' do
|
||||
expect(page).to have_css('#login_user')
|
||||
end
|
||||
end
|
||||
context 'when clicking on profile' do
|
||||
before do
|
||||
page.find_by_id('profile').click
|
||||
end
|
||||
scenario 'it redirects to profile page' do
|
||||
expect(page).to have_css('#profile_page')
|
||||
end
|
||||
context 'when clicking on procedure' do
|
||||
before do
|
||||
page.find_by_id('admin_menu').click
|
||||
page.find_by_id('menu_item_procedure').click
|
||||
end
|
||||
|
||||
scenario 'it redirects to procedure page' do
|
||||
expect(page).to have_content('Gestion des procédures')
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
end
|
Loading…
Reference in a new issue