Commit b944a0d4 authored by Mike Kozono's avatar Mike Kozono

Add integration tests for verifiable replicators

Reasons for putting these tests here instead of in the specs of these
workers:

* These tests should be run for all Replicators
* Each Replicator may have varying test setups, which is already
  done for these shared examples.
parent e3533bae
......@@ -335,4 +335,32 @@ RSpec.shared_examples 'a verifiable replicator' do
replicator.verify
end
end
context 'integration tests' do
before do
model_record.save!
end
context 'on a primary' do
before do
stub_primary_node
end
describe 'background backfill' do
it 'verifies model records' do
expect do
Geo::VerificationBatchWorker.new.perform(replicator.replicable_name)
end.to change { model_record.reload.verification_succeeded? }.from(false).to(true)
end
end
describe 'triggered by events' do
it 'verifies model records' do
expect do
Geo::VerificationWorker.new.perform(replicator.replicable_name, replicator.model_record_id)
end.to change { model_record.reload.verification_succeeded? }.from(false).to(true)
end
end
end
end
end
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