Commit 664b91fd authored by Alex Pooley's avatar Alex Pooley Committed by Sean McGivern

Removed setup! from worker spec

parent 5a378f14
...@@ -13,8 +13,6 @@ RSpec.describe PagesTransferWorker do ...@@ -13,8 +13,6 @@ RSpec.describe PagesTransferWorker do
before do before do
FileUtils.mkdir_p(pages_path_before) FileUtils.mkdir_p(pages_path_before)
FileUtils.touch(config_path_before) FileUtils.touch(config_path_before)
setup!
end end
after do after do
...@@ -54,7 +52,7 @@ RSpec.describe PagesTransferWorker do ...@@ -54,7 +52,7 @@ RSpec.describe PagesTransferWorker do
# Store the path before we change it # Store the path before we change it
let!(:args) { [project.path, subgroup.full_path, new_path] } let!(:args) { [project.path, subgroup.full_path, new_path] }
def setup! before do
# We need to skip hooks, otherwise the directory will be moved # We need to skip hooks, otherwise the directory will be moved
# via an ActiveRecord callback # via an ActiveRecord callback
subgroup.update_columns(parent_id: group_2.id) subgroup.update_columns(parent_id: group_2.id)
...@@ -73,11 +71,11 @@ RSpec.describe PagesTransferWorker do ...@@ -73,11 +71,11 @@ RSpec.describe PagesTransferWorker do
let(:meth) { 'move_project' } let(:meth) { 'move_project' }
let(:args) { [project.path, group_1.full_path, group_2.full_path] } let(:args) { [project.path, group_1.full_path, group_2.full_path] }
def setup! include_examples 'moving a pages directory' do
before do
project.update!(group: group_2) project.update!(group: group_2)
end end
end
include_examples 'moving a pages directory'
end end
describe 'when method is rename_project' do describe 'when method is rename_project' do
...@@ -89,11 +87,11 @@ RSpec.describe PagesTransferWorker do ...@@ -89,11 +87,11 @@ RSpec.describe PagesTransferWorker do
# Store the path before we change it # Store the path before we change it
let!(:args) { [project.path, new_path, project.namespace.full_path] } let!(:args) { [project.path, new_path, project.namespace.full_path] }
def setup! include_examples 'moving a pages directory' do
before do
project.update!(path: new_path) project.update!(path: new_path)
end end
end
include_examples 'moving a pages directory'
end end
describe 'when method is rename_namespace' do describe 'when method is rename_namespace' do
...@@ -106,7 +104,7 @@ RSpec.describe PagesTransferWorker do ...@@ -106,7 +104,7 @@ RSpec.describe PagesTransferWorker do
# Store the path before we change it # Store the path before we change it
let!(:args) { [project.namespace.full_path, new_path] } let!(:args) { [project.namespace.full_path, new_path] }
def setup! before do
# We need to skip hooks, otherwise the directory will be moved # We need to skip hooks, otherwise the directory will be moved
# via an ActiveRecord callback # via an ActiveRecord callback
group.update_columns(path: new_path) group.update_columns(path: new_path)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment