Rename verify_restore to verify_backup_version

parent 8c4e1c7e
......@@ -107,7 +107,7 @@ module Backup
end
end
def verify_restore
def verify_backup_version
Dir.chdir(backup_path) do
ENV["VERSION"] = "#{settings[:db_version]}" if settings[:db_version].to_i > 0
# restoring mismatching backups can lead to unexpected problems
......
......@@ -214,26 +214,26 @@ describe Backup::Manager do
end
end
describe 'verify_restore' do
context 'on Version mismatch' do
describe 'verify_backup_version' do
context 'on version mismatch' do
let(:gitlab_version) { Gitlab::VERSION }
it 'stops the process' do
allow(YAML).to receive(:load_file)
.and_return({ gitlab_version: "not #{gitlab_version}" })
expect { subject.verify_restore }.to raise_error SystemExit
expect { subject.verify_backup_version }.to raise_error SystemExit
end
end
context 'on Version match' do
context 'on version match' do
let(:gitlab_version) { Gitlab::VERSION }
it 'does nothing' do
allow(YAML).to receive(:load_file)
.and_return({ gitlab_version: "#{gitlab_version}" })
expect { subject.verify_restore }.not_to raise_error
expect { subject.verify_backup_version }.not_to raise_error
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