debian-mirror-gitlab/spec/support/helpers/stubbed_member.rb

27 lines
715 B
Ruby
Raw Normal View History

2022-08-27 11:52:29 +05:30
# frozen_string_literal: true
# Extend the ProjectMember & GroupMember class with the ability to
# to run project_authorizations refresh jobs inline.
# This is needed so that calls like `group.add_member(user, access_level)` or `create(:project_member)`
# in the specs can be run without including `:sidekiq_inline` trait.
module StubbedMember
extend ActiveSupport::Concern
module Member
private
2023-04-23 21:23:45 +05:30
def refresh_member_authorized_projects
2022-08-27 11:52:29 +05:30
AuthorizedProjectsWorker.new.perform(user_id)
end
end
module ProjectMember
private
2023-04-23 21:23:45 +05:30
def execute_project_authorizations_refresh
2022-08-27 11:52:29 +05:30
AuthorizedProjectUpdate::ProjectRecalculatePerUserWorker.new.perform(project.id, user.id)
end
end
end