summaryrefslogtreecommitdiff
path: root/spec/features/dashboard/group_dashboard_with_external_authorization_service_spec.rb
blob: 179d9d0990561adcfbe60c511876e9e38ea537df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'The group dashboard' do
  include ExternalAuthorizationServiceHelpers

  let(:user) { create(:user) }

  before do
    stub_feature_flags(combined_menu: false)

    sign_in user
  end

  describe 'The top navigation' do
    it 'has all the expected links' do
      visit dashboard_groups_path

      within('.navbar') do
        expect(page).to have_button('Projects')
        expect(page).to have_button('Groups')
        expect(page).to have_link('Activity')
        expect(page).to have_link('Milestones')
        expect(page).to have_link('Snippets')
      end
    end

    it 'hides some links when an external authorization service is enabled' do
      enable_external_authorization_service_check
      visit dashboard_groups_path

      within('.navbar') do
        expect(page).to have_button('Projects')
        expect(page).to have_button('Groups')
        expect(page).not_to have_link('Activity')
        expect(page).not_to have_link('Milestones')
        expect(page).to have_link('Snippets')
      end
    end
  end
end