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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorMichael Kozono <mkozono@gmail.com>2019-08-27 01:40:42 +0300
committerMichael Kozono <mkozono@gmail.com>2019-08-27 01:40:42 +0300
commit452b5d605c7ef88c8385cb62afcfc78f45ea2d4c (patch)
tree86a871fb97446df0061b6a8d3710b7affe8fab1d /spec
parent0f8058bc580ae09df71563c83fca2cc3ceb751fa (diff)
parent6fa5f510e83a91e19a1601bf6c01a9cffe6fd5c9 (diff)
Merge branch 'sh-guard-against-orphaned-project-feature' into 'master'
Guard against deleted project feature entry Closes #66482 See merge request gitlab-org/gitlab-ce!32187
Diffstat (limited to 'spec')
-rw-r--r--spec/policies/project_policy_spec.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/spec/policies/project_policy_spec.rb b/spec/policies/project_policy_spec.rb
index 8fd54e0bf1d..71ba73d5661 100644
--- a/spec/policies/project_policy_spec.rb
+++ b/spec/policies/project_policy_spec.rb
@@ -94,6 +94,19 @@ describe ProjectPolicy do
permissions.each { |p| is_expected.not_to be_allowed(p) }
end
+ context 'with no project feature' do
+ subject { described_class.new(owner, project) }
+
+ before do
+ project.project_feature.destroy
+ project.reload
+ end
+
+ it 'returns false' do
+ is_expected.to be_disallowed(:read_build)
+ end
+ end
+
it 'does not include the read_issue permission when the issue author is not a member of the private project' do
project = create(:project, :private)
issue = create(:issue, project: project, author: create(:user))