summaryrefslogtreecommitdiff
path: root/spec/models/project_team_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/project_team_spec.rb')
-rw-r--r--spec/models/project_team_spec.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/spec/models/project_team_spec.rb b/spec/models/project_team_spec.rb
index 5b11f9d828a..2ddbab7779e 100644
--- a/spec/models/project_team_spec.rb
+++ b/spec/models/project_team_spec.rb
@@ -410,6 +410,22 @@ RSpec.describe ProjectTeam do
end
end
+ describe '#purge_member_access_cache_for_user_id', :request_store do
+ let(:project) { create(:project) }
+ let(:user_id) { 1 }
+ let(:resource_data) { { user_id => 50, 42 => 50 } }
+
+ before do
+ Gitlab::SafeRequestStore[project.max_member_access_for_resource_key(User)] = resource_data
+ end
+
+ it 'removes cached max access for user from store' do
+ project.team.purge_member_access_cache_for_user_id(user_id)
+
+ expect(Gitlab::SafeRequestStore[project.max_member_access_for_resource_key(User)]).to eq({ 42 => 50 })
+ end
+ end
+
describe '#member?' do
let(:group) { create(:group) }
let(:developer) { create(:user) }