link to organization#new from user menu
This commit is contained in:
parent
d9b2ebfc36
commit
61ddbcfe04
3 changed files with 34 additions and 7 deletions
|
|
@ -23,6 +23,10 @@
|
||||||
New Conference
|
New Conference
|
||||||
- if can? :index, User
|
- if can? :index, User
|
||||||
%hr
|
%hr
|
||||||
|
%li
|
||||||
|
= link_to(admin_organizations_path) do
|
||||||
|
%span.fa.fa-group
|
||||||
|
Organizations
|
||||||
%li
|
%li
|
||||||
= link_to(admin_users_path) do
|
= link_to(admin_users_path) do
|
||||||
%span.fa.fa-user
|
%span.fa.fa-user
|
||||||
|
|
@ -32,8 +36,3 @@
|
||||||
= link_to(admin_revision_history_path) do
|
= link_to(admin_revision_history_path) do
|
||||||
%span.fa.fa-history
|
%span.fa.fa-history
|
||||||
Revision History
|
Revision History
|
||||||
- if ENV['ORGANIZATIONS_ENABLED'] == 'true'
|
|
||||||
%li
|
|
||||||
= link_to(admin_organizations_path) do
|
|
||||||
%span.fa.fa-group
|
|
||||||
Organizations
|
|
||||||
|
|
|
||||||
|
|
@ -28,8 +28,12 @@
|
||||||
= link_to(admin_conferences_path()) do
|
= link_to(admin_conferences_path()) do
|
||||||
%span.fa.fa-home
|
%span.fa.fa-home
|
||||||
Administration
|
Administration
|
||||||
- if can? :new, Conference.new
|
- if (can? :new, Organization.new) && !Organization.any?
|
||||||
=link_to(new_admin_conference_path) do
|
= link_to(new_admin_organization_path) do
|
||||||
|
%span.fa.fa-plus
|
||||||
|
New Organization
|
||||||
|
- if (can? :new, Conference.new) && Organization.any?
|
||||||
|
= link_to(new_admin_conference_path) do
|
||||||
%span.fa.fa-plus
|
%span.fa.fa-plus
|
||||||
New Conference
|
New Conference
|
||||||
-if @conference and @conference.id and can? :show, @conference
|
-if @conference and @conference.id and can? :show, @conference
|
||||||
|
|
|
||||||
24
spec/features/user_menu_spec.rb
Normal file
24
spec/features/user_menu_spec.rb
Normal file
|
|
@ -0,0 +1,24 @@
|
||||||
|
require 'spec_helper'
|
||||||
|
|
||||||
|
feature '_user_menu' do
|
||||||
|
let(:admin) { create(:admin) }
|
||||||
|
subject { page }
|
||||||
|
before { sign_in admin }
|
||||||
|
|
||||||
|
scenario 'when no organization is present', feature: true, js: true do
|
||||||
|
visit root_path
|
||||||
|
click_link admin.name
|
||||||
|
|
||||||
|
is_expected.to have_text('New Organization')
|
||||||
|
is_expected.to_not have_text('New Conference')
|
||||||
|
end
|
||||||
|
|
||||||
|
scenario 'when organization is present', feature: true, js: true do
|
||||||
|
create(:organization)
|
||||||
|
visit root_path
|
||||||
|
click_link admin.name
|
||||||
|
|
||||||
|
is_expected.to_not have_text('New Organization')
|
||||||
|
is_expected.to have_text('New Conference')
|
||||||
|
end
|
||||||
|
end
|
||||||
Loading…
Add table
Add a link
Reference in a new issue