Commit c13972ea authored by James Fargher's avatar James Fargher

Merge branch 'pl-spec-blob-policy-perf' into 'master'

Improve performance of blob policy spec

See merge request gitlab-org/gitlab!78381
parents 62fcdefa 8a188537
...@@ -5,9 +5,9 @@ require 'spec_helper' ...@@ -5,9 +5,9 @@ require 'spec_helper'
RSpec.describe BlobPolicy do RSpec.describe BlobPolicy do
include_context 'ProjectPolicyTable context' include_context 'ProjectPolicyTable context'
include ProjectHelpers include ProjectHelpers
using RSpec::Parameterized::TableSyntax
let(:project) { create(:project, :repository, project_level) } let_it_be_with_reload(:project) { create(:project, :repository) }
let(:user) { create_user_from_membership(project, membership) } let(:user) { create_user_from_membership(project, membership) }
let(:blob) { project.repository.blob_at(SeedRepo::FirstCommit::ID, 'README.md') } let(:blob) { project.repository.blob_at(SeedRepo::FirstCommit::ID, 'README.md') }
...@@ -18,8 +18,9 @@ RSpec.describe BlobPolicy do ...@@ -18,8 +18,9 @@ RSpec.describe BlobPolicy do
end end
with_them do with_them do
it "grants permission" do it 'grants permission' do
enable_admin_mode!(user) if admin_mode enable_admin_mode!(user) if admin_mode
project.update!(visibility_level: Gitlab::VisibilityLevel.level_value(project_level.to_s))
update_feature_access_level(project, feature_access_level) update_feature_access_level(project, feature_access_level)
if expected_count == 1 if expected_count == 1
......
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