Welcome to mirror list, hosted at ThFree Co, Russian Federation.

protected_branches.rb « policies « shared_examples « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 39652434acbacb86daa761e00bc9491053ddf4a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

RSpec.shared_examples 'allows protected branch crud' do
  it { is_expected.to be_allowed(:read_protected_branch) }
  it { is_expected.to be_allowed(:create_protected_branch) }
  it { is_expected.to be_allowed(:update_protected_branch) }
  it { is_expected.to be_allowed(:destroy_protected_branch) }
end

RSpec.shared_examples 'disallows protected branch crud' do
  it { is_expected.not_to be_allowed(:read_protected_branch) }
  it { is_expected.not_to be_allowed(:create_protected_branch) }
  it { is_expected.not_to be_allowed(:update_protected_branch) }
  it { is_expected.not_to be_allowed(:destroy_protected_branch) }
end

RSpec.shared_examples 'disallows protected branch changes' do
  it { is_expected.not_to be_allowed(:create_protected_branch) }
  it { is_expected.not_to be_allowed(:update_protected_branch) }
  it { is_expected.not_to be_allowed(:destroy_protected_branch) }
end