Commit 85f03822 authored by Mike Kozono's avatar Mike Kozono Committed by Douglas Barbosa Alexandre

Fix test setup

The negative test was improperly passing, because model_record didn't
exist.
parent 1377018a
...@@ -71,14 +71,16 @@ RSpec.shared_examples 'a repository replicator' do ...@@ -71,14 +71,16 @@ RSpec.shared_examples 'a repository replicator' do
end end
describe 'updated event consumption' do describe 'updated event consumption' do
before do
model_record.save!
end
context 'in replicables_for_current_secondary list' do context 'in replicables_for_current_secondary list' do
it 'runs SnippetRepositorySyncService service' do it 'runs SnippetRepositorySyncService service' do
model_record.save! allow(replicator).to receive(:in_replicables_for_current_secondary?).and_return(true)
sync_service = double sync_service = double
expect(sync_service).to receive(:execute) expect(sync_service).to receive(:execute)
expect(::Geo::FrameworkRepositorySyncService) expect(::Geo::FrameworkRepositorySyncService)
.to receive(:new).with(replicator) .to receive(:new).with(replicator)
.and_return(sync_service) .and_return(sync_service)
...@@ -89,6 +91,8 @@ RSpec.shared_examples 'a repository replicator' do ...@@ -89,6 +91,8 @@ RSpec.shared_examples 'a repository replicator' do
context 'not in replicables_for_current_secondary list' do context 'not in replicables_for_current_secondary list' do
it 'runs SnippetRepositorySyncService service' do it 'runs SnippetRepositorySyncService service' do
allow(replicator).to receive(:in_replicables_for_current_secondary?).and_return(false)
expect(::Geo::FrameworkRepositorySyncService) expect(::Geo::FrameworkRepositorySyncService)
.not_to receive(:new) .not_to receive(:new)
......
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