profile_spec.rb 738 B

1234567891011121314151617181920212223
  1. require 'rails_helper'
  2. RSpec.describe 'Profile', type: :system do
  3. it 'shows profile link in navigation' do
  4. visit 'dashboard'
  5. find('a[href="#current_user"]').click
  6. expect(page).to have_css('.dropdown-menu > li > a[href="#profile"]')
  7. end
  8. context 'when user is an agent with no user_preferences permission', authenticated_as: :new_user do
  9. let(:role) { create(:role, permissions: [Permission.find_by(name: 'ticket.agent')]) }
  10. let(:new_user) { create(:user, roles: [role] ) }
  11. it 'does not show profile link in navigation' do
  12. visit 'dashboard'
  13. find('a[href="#current_user"]').click
  14. expect(page).to have_no_css('.dropdown-menu > li > a[href="#profile"]')
  15. end
  16. end
  17. end