summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--spec/migrations/rename_reserved_project_names_spec.rb8
1 files changed, 5 insertions, 3 deletions
diff --git a/spec/migrations/rename_reserved_project_names_spec.rb b/spec/migrations/rename_reserved_project_names_spec.rb
index 66f68570b50..4fb7ed36884 100644
--- a/spec/migrations/rename_reserved_project_names_spec.rb
+++ b/spec/migrations/rename_reserved_project_names_spec.rb
@@ -3,14 +3,16 @@
require 'spec_helper'
require Rails.root.join('db', 'post_migrate', '20161221153951_rename_reserved_project_names.rb')
-describe RenameReservedProjectNames do
+# This migration uses multiple threads, and thus different transactions. This
+# means data created in this spec may not be visible to some threads. To work
+# around this we use the TRUNCATE cleaning strategy.
+describe RenameReservedProjectNames, truncate: true do
let(:migration) { described_class.new }
- let!(:project) { create(:project) }
+ let!(:project) { create(:empty_project) }
before do
project.path = 'projects'
project.save!(validate: false)
- allow(Thread).to receive(:new).and_yield
end
describe '#up' do