diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-12-19 14:01:45 +0300 |
commit | 9297025d0b7ddf095eb618dfaaab2ff8f2018d8b (patch) | |
tree | 865198c01d1824a9b098127baa3ab980c9cd2c06 /spec/services/projects/unlink_fork_service_spec.rb | |
parent | 6372471f43ee03c05a7c1f8b0c6ac6b8a7431dbe (diff) |
Add latest changes from gitlab-org/gitlab@16-7-stable-eev16.7.0-rc42
Diffstat (limited to 'spec/services/projects/unlink_fork_service_spec.rb')
-rw-r--r-- | spec/services/projects/unlink_fork_service_spec.rb | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/spec/services/projects/unlink_fork_service_spec.rb b/spec/services/projects/unlink_fork_service_spec.rb index 872e38aba1d..2e1a6c03c90 100644 --- a/spec/services/projects/unlink_fork_service_spec.rb +++ b/spec/services/projects/unlink_fork_service_spec.rb @@ -58,6 +58,26 @@ RSpec.describe Projects::UnlinkForkService, :use_clean_rails_memory_store_cachin expect(source.forks_count).to be_zero end + it 'refreshes the project statistics of the forked project' do + expect(ProjectCacheWorker).to receive(:perform_async).with(forked_project.id, [], [:repository_size]) + + subject.execute + end + + it 'does not refresh project statistics when refresh_statistics is false' do + expect(ProjectCacheWorker).not_to receive(:perform_async) + + subject.execute(refresh_statistics: false) + end + + it 'does not refresh project statistics when the feature flag is disabled' do + stub_feature_flags(refresh_statistics_on_unlink_fork: false) + + expect(ProjectCacheWorker).not_to receive(:perform_async) + + subject.execute + end + context 'when the original project was deleted' do it 'does not fail when the original project is deleted' do source = forked_project.forked_from_project |