Commit a3caa0cf authored by Mike Kozono's avatar Mike Kozono Committed by Brian Williams

Add coverage for ReplicableModel.verifiables

These tests document current intended behavior. If/when we implement
"Allow verification of files in Object Storage"
https://gitlab.com/gitlab-org/gitlab/-/issues/13845, then that new
setting would be involved in these tests.
parent 9bdf73a5
......@@ -34,6 +34,30 @@ RSpec.describe Geo::ReplicableModel do
let(:replicator_class) { Geo::DummyReplicator }
end
describe '.verifiables' do
context 'when the model can be filtered by locally stored files' do
it 'filters by locally stored files' do
allow(DummyModel).to receive(:respond_to?).with(:all).and_call_original
allow(DummyModel).to receive(:respond_to?).with(:with_files_stored_locally).and_return(true)
expect(DummyModel).to receive(:with_files_stored_locally)
DummyModel.verifiables
end
end
context 'when the model cannot be filtered by locally stored files' do
it 'does not filter by locally stored files' do
allow(DummyModel).to receive(:respond_to?).with(:all).and_call_original
allow(DummyModel).to receive(:respond_to?).with(:with_files_stored_locally).and_return(false)
expect(DummyModel).not_to receive(:with_files_stored_locally)
DummyModel.verifiables
end
end
end
describe '#replicator' do
it 'adds replicator method to the model' do
expect(subject).to respond_to(:replicator)
......
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