summaryrefslogtreecommitdiff
path: root/spec/lib/gitlab/background_migration/populate_fork_networks_range_spec.rb
diff options
context:
space:
mode:
authorWinnie Hellmann <winnie@gitlab.com>2017-12-14 12:22:14 +0000
committerWinnie Hellmann <winnie@gitlab.com>2017-12-14 12:22:14 +0000
commiteb98a6f6ecbd75f1f63fcfb119b2927bc2418449 (patch)
treed99b722f85faf72c8231ebe0b70a491d73339181 /spec/lib/gitlab/background_migration/populate_fork_networks_range_spec.rb
parentb452d57e6db71779871e943a0409ed8e5a8695cd (diff)
parent5708bd6c70b2964a838369a35c3545c470f6d22a (diff)
downloadgitlab-ce-eb98a6f6ecbd75f1f63fcfb119b2927bc2418449.tar.gz
Merge branch 'bvl-fork-networks-for-deleted-projects-10-2' into '10-2-stable-patch-5'
Create fork networks for deleted source projects (10.2 port) See merge request gitlab-org/gitlab-ce!15927
Diffstat (limited to 'spec/lib/gitlab/background_migration/populate_fork_networks_range_spec.rb')
-rw-r--r--spec/lib/gitlab/background_migration/populate_fork_networks_range_spec.rb7
1 files changed, 5 insertions, 2 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 994992f79d4..e52baf8dde7 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,12 +62,15 @@ 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)
+ it 'creates a fork network for the fork of which the source was deleted' do
+ fork = create(:project)
+ forked_project_links.create(id: 6, forked_from_project_id: 99999, forked_to_project_id: fork.id)
migration.perform(5, 8)
expect(fork_networks.find_by(root_project_id: 99999)).to be_nil
+ expect(fork_networks.find_by(root_project_id: fork.id)).not_to be_nil
+ expect(fork_network_members.find_by(project_id: fork.id)).not_to be_nil
end
it 'schedules a job for inserting memberships for forks-of-forks' do