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

project_statistics_refresh_conflicts_shared_examples.rb « api « requests « shared_examples « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 7c3f4781472288da05f2f1e68d255a53dc184c6a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

RSpec.shared_examples 'preventing request because of ongoing project stats refresh' do |entrypoint|
  before do
    create(:project_build_artifacts_size_refresh, :pending, project: project)
  end

  it 'logs about the rejected request' do
    expect(Gitlab::ProjectStatsRefreshConflictsLogger)
      .to receive(:warn_request_rejected_during_stats_refresh)
      .with(project.id)

    make_request
  end

  it 'returns 409 error' do
    make_request

    expect(response).to have_gitlab_http_status(:conflict)
  end
end