summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorBob Van Landuyt <bob@vanlanduyt.co>2017-10-08 18:16:04 +0200
committerBob Van Landuyt <bob@vanlanduyt.co>2017-10-09 08:44:23 +0200
commit392e5df796166f0ebe04cca8f6301bcdc676543e (patch)
treec3f6d2a995c28ca81dd1639d70619a9bb83d277b /spec
parent91f1d652f5a0ab82784fed6d81501d03113d2cd7 (diff)
downloadgitlab-ce-392e5df796166f0ebe04cca8f6301bcdc676543e.tar.gz
Don't create fork networks for root projects that are deletedbvl-fork-network-migrations
Diffstat (limited to 'spec')
-rw-r--r--spec/lib/gitlab/background_migration/populate_fork_networks_range_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/lib/gitlab/background_migration/populate_fork_networks_range_spec.rb b/spec/lib/gitlab/background_migration/populate_fork_networks_range_spec.rb
index 3ef1873e615..2c2684a6fc9 100644
--- a/spec/lib/gitlab/background_migration/populate_fork_networks_range_spec.rb
+++ b/spec/lib/gitlab/background_migration/populate_fork_networks_range_spec.rb
@@ -62,6 +62,14 @@ describe Gitlab::BackgroundMigration::PopulateForkNetworksRange, :migration, sch
expect(base2_membership).not_to be_nil
end
+ it 'skips links that had their source project deleted' do
+ forked_project_links.create(id: 6, forked_from_project_id: 99999, forked_to_project_id: create(:project).id)
+
+ migration.perform(5, 8)
+
+ expect(fork_networks.find_by(root_project_id: 99999)).to be_nil
+ end
+
it 'schedules a job for inserting memberships for forks-of-forks' do
delay = Gitlab::BackgroundMigration::CreateForkNetworkMembershipsRange::RESCHEDULE_DELAY