diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 10:34:06 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-02-18 10:34:06 +0000 |
commit | 859a6fb938bb9ee2a317c46dfa4fcc1af49608f0 (patch) | |
tree | d7f2700abe6b4ffcb2dcfc80631b2d87d0609239 /spec/controllers/repositories | |
parent | 446d496a6d000c73a304be52587cd9bbc7493136 (diff) | |
download | gitlab-ce-859a6fb938bb9ee2a317c46dfa4fcc1af49608f0.tar.gz |
Add latest changes from gitlab-org/gitlab@13-9-stable-eev13.9.0-rc42
Diffstat (limited to 'spec/controllers/repositories')
-rw-r--r-- | spec/controllers/repositories/git_http_controller_spec.rb | 33 |
1 files changed, 28 insertions, 5 deletions
diff --git a/spec/controllers/repositories/git_http_controller_spec.rb b/spec/controllers/repositories/git_http_controller_spec.rb index 34052496871..d21f602f90c 100644 --- a/spec/controllers/repositories/git_http_controller_spec.rb +++ b/spec/controllers/repositories/git_http_controller_spec.rb @@ -36,7 +36,7 @@ RSpec.describe Repositories::GitHttpController do context 'when project_statistics_sync feature flag is disabled' do before do - stub_feature_flags(project_statistics_sync: false) + stub_feature_flags(project_statistics_sync: false, disable_git_http_fetch_writes: false) end it 'updates project statistics async for projects' do @@ -47,17 +47,40 @@ RSpec.describe Repositories::GitHttpController do end it 'updates project statistics sync for projects' do + stub_feature_flags(disable_git_http_fetch_writes: false) + expect { send_request }.to change { Projects::DailyStatisticsFinder.new(container).total_fetch_count }.from(0).to(1) end - it 'records an onboarding progress action' do - expect_next_instance_of(OnboardingProgressService) do |service| - expect(service).to receive(:execute).with(action: :git_read) + it_behaves_like 'records an onboarding progress action', :git_read do + let(:namespace) { project.namespace } + + subject { send_request } + + before do + stub_feature_flags(disable_git_http_fetch_writes: false) + end + end + + context 'when disable_git_http_fetch_writes is enabled' do + before do + stub_feature_flags(disable_git_http_fetch_writes: true) + end + + it 'does not increment statistics' do + expect(Projects::FetchStatisticsIncrementService).not_to receive(:new) + expect(ProjectDailyStatisticsWorker).not_to receive(:perform_async) + + send_request end - send_request + it 'does not record onboarding progress' do + expect(OnboardingProgressService).not_to receive(:new) + + send_request + end end end end |