debian-mirror-gitlab/spec/lib/backup/database_backup_error_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

31 lines
848 B
Ruby
Raw Normal View History

2021-10-27 15:23:28 +05:30
# frozen_string_literal: true
2022-10-11 01:57:18 +05:30
require 'fast_spec_helper'
2021-10-27 15:23:28 +05:30
RSpec.describe Backup::DatabaseBackupError do
let(:config) do
{
host: 'localhost',
port: 5432,
database: 'gitlabhq_test'
}
end
let(:db_file_name) { File.join(Gitlab.config.backup.path, 'db', 'database.sql.gz') }
subject { described_class.new(config, db_file_name) }
it { is_expected.to respond_to :config }
it { is_expected.to respond_to :db_file_name }
it 'expects exception message to include database file' do
2023-01-13 00:05:48 +05:30
expect(subject.message).to include(db_file_name.to_s)
2021-10-27 15:23:28 +05:30
end
it 'expects exception message to include database paths being back-up' do
2023-01-13 00:05:48 +05:30
expect(subject.message).to include(config[:host].to_s)
expect(subject.message).to include(config[:port].to_s)
expect(subject.message).to include(config[:database].to_s)
2021-10-27 15:23:28 +05:30
end
end