Welcome to mirror list, hosted at ThFree Co, Russian Federation.

single_change_access_checks_shared_context.rb « shared_contexts « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: bf90c26047b6bfd645023fc5cf939dbc0a76001a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# frozen_string_literal: true

RSpec.shared_context 'change access checks context' do
  let(:user) { create(:user) }
  let(:project) { create(:project, :repository) }
  let(:user_access) { Gitlab::UserAccess.new(user, container: project) }
  let(:oldrev) { 'be93687618e4b132087f430a4d8fc3a609c9b77c' }
  let(:newrev) { '54fcc214b94e78d7a41a9a8fe6d87a5e59500e51' }
  let(:ref) { 'refs/heads/master' }
  let(:changes) { { oldrev: oldrev, newrev: newrev, ref: ref } }
  let(:protocol) { 'ssh' }
  let(:timeout) { Gitlab::GitAccess::INTERNAL_TIMEOUT }
  let(:logger) { Gitlab::Checks::TimedLogger.new(timeout: timeout) }
  let(:change_access) do
    Gitlab::Checks::SingleChangeAccess.new(
      changes,
      project: project,
      user_access: user_access,
      protocol: protocol,
      logger: logger
    )
  end

  subject { described_class.new(change_access) }

  before do
    project.add_developer(user)
  end
end