Improve spec for Geo::RepositoriesCleanUpWorker

parent aa06b60e
require 'spec_helper'
describe Geo::RepositoriesCleanUpWorker do
let!(:geo_node) { create(:geo_node) }
let(:group) { create(:group) }
let!(:project_1) { create(:project, group: group) }
let!(:project_2) { create(:project) }
let!(:geo_node) { create(:geo_node) }
let(:synced_group) { create(:group) }
let!(:project_in_synced_group) { create(:project, group: synced_group) }
let!(:unsynced_project) { create(:project) }
describe '#perform' do
before do
......@@ -13,10 +13,10 @@ describe Geo::RepositoriesCleanUpWorker do
context 'when node has namespace restrictions' do
it 'performs GeoRepositoryDestroyWorker for each project that does not belong to selected namespaces to replicate' do
geo_node.update_attribute(:namespaces, [group])
geo_node.update_attribute(:namespaces, [synced_group])
expect(GeoRepositoryDestroyWorker).to receive(:perform_async)
.with(project_2.id, project_2.name, project_2.full_path)
.with(unsynced_project.id, unsynced_project.name, unsynced_project.full_path)
.once.and_return(1)
subject.perform(geo_node.id)
......
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