Commit 957fde1a authored by Peter Leitzen's avatar Peter Leitzen

Merge branch 'leaky-constant-fix-15' into 'master'

Fix leaky constant in merge request policy spec

See merge request gitlab-org/gitlab!32044
parents cbebb046 ff650a9b
...@@ -385,7 +385,6 @@ RSpec/LeakyConstantDeclaration: ...@@ -385,7 +385,6 @@ RSpec/LeakyConstantDeclaration:
- 'spec/models/concerns/bulk_insertable_associations_spec.rb' - 'spec/models/concerns/bulk_insertable_associations_spec.rb'
- 'spec/models/concerns/triggerable_hooks_spec.rb' - 'spec/models/concerns/triggerable_hooks_spec.rb'
- 'spec/models/repository_spec.rb' - 'spec/models/repository_spec.rb'
- 'spec/policies/merge_request_policy_spec.rb'
- 'spec/requests/api/graphql/tasks/task_completion_status_spec.rb' - 'spec/requests/api/graphql/tasks/task_completion_status_spec.rb'
- 'spec/rubocop/cop/rspec/env_assignment_spec.rb' - 'spec/rubocop/cop/rspec/env_assignment_spec.rb'
- 'spec/serializers/commit_entity_spec.rb' - 'spec/serializers/commit_entity_spec.rb'
......
---
title: Fix leaky constant issue in merge request policy spec
merge_request: 32044
author: Rajendra Kadam
type: fixed
...@@ -21,7 +21,7 @@ describe MergeRequestPolicy do ...@@ -21,7 +21,7 @@ describe MergeRequestPolicy do
project.add_developer(developer) project.add_developer(developer)
end end
MR_PERMS = %i[create_merge_request_in mr_perms = %i[create_merge_request_in
create_merge_request_from create_merge_request_from
read_merge_request read_merge_request
create_note].freeze create_note].freeze
...@@ -29,7 +29,7 @@ describe MergeRequestPolicy do ...@@ -29,7 +29,7 @@ describe MergeRequestPolicy do
shared_examples_for 'a denied user' do shared_examples_for 'a denied user' do
let(:perms) { permissions(subject, merge_request) } let(:perms) { permissions(subject, merge_request) }
MR_PERMS.each do |thing| mr_perms.each do |thing|
it "cannot #{thing}" do it "cannot #{thing}" do
expect(perms).to be_disallowed(thing) expect(perms).to be_disallowed(thing)
end end
...@@ -39,7 +39,7 @@ describe MergeRequestPolicy do ...@@ -39,7 +39,7 @@ describe MergeRequestPolicy do
shared_examples_for 'a user with access' do shared_examples_for 'a user with access' do
let(:perms) { permissions(subject, merge_request) } let(:perms) { permissions(subject, merge_request) }
MR_PERMS.each do |thing| mr_perms.each do |thing|
it "can #{thing}" do it "can #{thing}" do
expect(perms).to be_allowed(thing) expect(perms).to be_allowed(thing)
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment