summaryrefslogtreecommitdiff
path: root/spec/features/projects/settings/user_searches_in_settings_spec.rb
blob: a60743f0e47b15951b896640f57ac40ee9044cdf (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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'User searches project settings', :js do
  let_it_be(:user) { create(:user) }
  let_it_be(:project) { create(:project, :repository, namespace: user.namespace, pages_https_only: false) }

  before do
    sign_in(user)
  end

  context 'in general settings page' do
    before do
      visit edit_project_path(project)
    end

    it_behaves_like 'can search settings', 'Naming', 'Visibility'
  end

  context 'in Integrations page' do
    before do
      visit project_settings_integrations_path(project)
    end

    it_behaves_like 'can highlight results', 'third-party applications'
  end

  context 'in Webhooks page' do
    before do
      visit project_hooks_path(project)
    end

    it_behaves_like 'can highlight results', 'Secret token'
  end

  context 'in Access Tokens page' do
    before do
      visit project_settings_access_tokens_path(project)
    end

    it_behaves_like 'can highlight results', 'Expires at'
  end

  context 'in Repository page' do
    before do
      visit project_settings_repository_path(project)
    end

    it_behaves_like 'can search settings', 'Deploy keys', 'Mirroring repositories'
  end

  context 'in CI/CD page' do
    before do
      visit project_settings_ci_cd_path(project)
    end

    it_behaves_like 'can search settings', 'General pipelines', 'Auto DevOps'
  end

  context 'in Operations page' do
    before do
      visit project_settings_operations_path(project)
    end

    it_behaves_like 'can search settings', 'Alerts', 'Error tracking'
  end

  context 'in Pages page' do
    before do
      allow(Gitlab.config.pages).to receive(:enabled).and_return(true)

      visit project_pages_path(project)
    end

    it_behaves_like 'can highlight results', 'static website'
  end
end