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
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/users/refresh_authorized_projects_service_spec.rb')
-rw-r--r--spec/services/users/refresh_authorized_projects_service_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/services/users/refresh_authorized_projects_service_spec.rb b/spec/services/users/refresh_authorized_projects_service_spec.rb
index 9404668e3c5..cc01b22f9d2 100644
--- a/spec/services/users/refresh_authorized_projects_service_spec.rb
+++ b/spec/services/users/refresh_authorized_projects_service_spec.rb
@@ -143,6 +143,21 @@ RSpec.describe Users::RefreshAuthorizedProjectsService do
expect(authorizations[0].project_id).to eq(project.id)
expect(authorizations[0].access_level).to eq(Gitlab::Access::MAINTAINER)
end
+
+ it 'logs the details of the refresh' do
+ source = :foo
+ service = described_class.new(user, source: source)
+ user.project_authorizations.delete_all
+
+ expect(Gitlab::AppJsonLogger).to(
+ receive(:info)
+ .with(event: 'authorized_projects_refresh',
+ 'authorized_projects_refresh.source': source,
+ 'authorized_projects_refresh.rows_deleted': 0,
+ 'authorized_projects_refresh.rows_added': 1))
+
+ service.update_authorizations([], [[user.id, project.id, Gitlab::Access::MAINTAINER]])
+ end
end
describe '#fresh_access_levels_per_project' do