Fix rename projects spec so it doesn't hang
This spec would hang due to the use of transactions, and would incorrectly stub Thread.new.
This commit is contained in:
parent
2f93259c6b
commit
123bc1d5eb
1 changed files with 5 additions and 3 deletions
|
@ -3,14 +3,16 @@
|
||||||
require 'spec_helper'
|
require 'spec_helper'
|
||||||
require Rails.root.join('db', 'post_migrate', '20161221153951_rename_reserved_project_names.rb')
|
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(:migration) { described_class.new }
|
||||||
let!(:project) { create(:project) }
|
let!(:project) { create(:empty_project) }
|
||||||
|
|
||||||
before do
|
before do
|
||||||
project.path = 'projects'
|
project.path = 'projects'
|
||||||
project.save!(validate: false)
|
project.save!(validate: false)
|
||||||
allow(Thread).to receive(:new).and_yield
|
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '#up' do
|
describe '#up' do
|
||||||
|
|
Loading…
Reference in a new issue