debian-mirror-gitlab/spec/support/shared_examples/requests/api/project_statistics_refresh_conflicts_shared_examples.rb
2022-07-23 20:15:48 +02:00

21 lines
552 B
Ruby

# 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