summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRémy Coutable <remy@rymai.me>2018-01-22 15:34:22 +0000
committerRémy Coutable <remy@rymai.me>2018-01-22 15:34:22 +0000
commit9053854e0e8643708c6c1365dc966f223be86fbb (patch)
tree8960e3fbf09c8909ecbea528f79915d62e59c12e
parentc4904d570c2c5094d2d2bfee5d243b39556fdc89 (diff)
parent49e72bccb2f474a1b6c5c0c718e1a3c5ba0cdc41 (diff)
downloadgitlab-ce-9053854e0e8643708c6c1365dc966f223be86fbb.tar.gz
Merge branch 'ce-fix-upload-model-tainted-after-migration-spec' into 'master'
Fix the Upload model being tainted after migration spec See merge request gitlab-org/gitlab-ce!16585
-rw-r--r--spec/migrations/remove_empty_fork_networks_spec.rb13
1 files changed, 10 insertions, 3 deletions
diff --git a/spec/migrations/remove_empty_fork_networks_spec.rb b/spec/migrations/remove_empty_fork_networks_spec.rb
index cf6ae5cda74..7f7ce91378b 100644
--- a/spec/migrations/remove_empty_fork_networks_spec.rb
+++ b/spec/migrations/remove_empty_fork_networks_spec.rb
@@ -3,12 +3,19 @@ require Rails.root.join('db', 'post_migrate', '20171114104051_remove_empty_fork_
describe RemoveEmptyForkNetworks, :migration do
let!(:fork_networks) { table(:fork_networks) }
+ let!(:projects) { table(:projects) }
+ let!(:fork_network_members) { table(:fork_network_members) }
- let(:deleted_project) { create(:project) }
- let!(:empty_network) { create(:fork_network, id: 1, root_project_id: deleted_project.id) }
- let!(:other_network) { create(:fork_network, id: 2, root_project_id: create(:project).id) }
+ let(:deleted_project) { projects.create! }
+ let!(:empty_network) { fork_networks.create!(id: 1, root_project_id: deleted_project.id) }
+ let!(:other_network) { fork_networks.create!(id: 2, root_project_id: projects.create.id) }
before do
+ fork_network_members.create(fork_network_id: empty_network.id,
+ project_id: empty_network.root_project_id)
+ fork_network_members.create(fork_network_id: other_network.id,
+ project_id: other_network.root_project_id)
+
deleted_project.destroy!
end