Add missing link and button on management interface

This commit is contained in:
Pierre Mesure
2019-08-23 23:43:22 +02:00
committed by Javi Martín
parent 031ec8fce1
commit 228a1d9090
2 changed files with 18 additions and 6 deletions

View File

@@ -11,6 +11,10 @@
<header class="header">
<div class="top-links">
<%= render "shared/locale_switcher" %>
<%= link_to root_path, class: "float-right" do %>
<%= t("admin.dashboard.index.back", org: setting["org_name"]) %>
<% end %>
</div>
<div class="expanded row admin-top-bar">
@@ -29,6 +33,7 @@
<div class="top-bar-right">
<ul class="menu" data-responsive-menu="medium-dropdown">
<%= render "shared/admin_login_items", current_user: manager_logged_in %>
<%= render "layouts/notification_item", current_user: manager_logged_in %>
<%= render "devise/menu/login_items", current_user: manager_logged_in %>
</ul>
</div>

View File

@@ -2,6 +2,7 @@ require "rails_helper"
describe "Management" do
let(:user) { create(:user) }
before { Setting["org_name"] = "CONSUL" }
scenario "Should show admin menu if logged user is admin" do
create(:administrator, user: user)
@@ -11,9 +12,12 @@ describe "Management" do
click_link "Menu"
click_link "Management"
expect(page).to have_content("My content")
expect(page).to have_content("My account")
expect(page).to have_content("Sign out")
expect(page).to have_link "Go back to CONSUL"
expect(page).to have_link "You don't have new notifications"
expect(page).to have_link "My content"
expect(page).to have_link "My account"
expect(page).to have_link "Sign out"
end
scenario "Should not show admin menu if logged user is manager" do
@@ -24,8 +28,11 @@ describe "Management" do
click_link "Menu"
click_link "Management"
expect(page).not_to have_content("My content")
expect(page).not_to have_content("My account")
expect(page).not_to have_content("Sign out")
expect(page).to have_link "Go back to CONSUL"
expect(page).not_to have_content "You don't have new notifications"
expect(page).not_to have_content "My content"
expect(page).not_to have_content "My account"
expect(page).not_to have_content "Sign out"
end
end