diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 04:45:44 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-09-19 04:45:44 +0300 |
commit | 85dc423f7090da0a52c73eb66faf22ddb20efff9 (patch) | |
tree | 9160f299afd8c80c038f08e1545be119f5e3f1e1 /spec/lib/backup/pages_spec.rb | |
parent | 15c2c8c66dbe422588e5411eee7e68f1fa440bb8 (diff) |
Add latest changes from gitlab-org/gitlab@13-4-stable-ee
Diffstat (limited to 'spec/lib/backup/pages_spec.rb')
-rw-r--r-- | spec/lib/backup/pages_spec.rb | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/lib/backup/pages_spec.rb b/spec/lib/backup/pages_spec.rb new file mode 100644 index 00000000000..59df4d1adf7 --- /dev/null +++ b/spec/lib/backup/pages_spec.rb @@ -0,0 +1,30 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe Backup::Pages do + let(:progress) { StringIO.new } + + subject { described_class.new(progress) } + + before do + allow(File).to receive(:realpath).with("/var/gitlab-pages").and_return("/var/gitlab-pages") + allow(File).to receive(:realpath).with("/var/gitlab-pages/..").and_return("/var") + end + + describe '#dump' do + it 'uses the correct pages dir' do + allow(Gitlab.config.pages).to receive(:path) { '/var/gitlab-pages' } + + expect(subject.app_files_dir).to eq('/var/gitlab-pages') + end + + it 'excludes tmp from backup tar' do + allow(Gitlab.config.pages).to receive(:path) { '/var/gitlab-pages' } + + expect(subject).to receive(:tar).and_return('blabla-tar') + expect(subject).to receive(:run_pipeline!).with([%w(blabla-tar --exclude=lost+found --exclude=./@pages.tmp -C /var/gitlab-pages -cf - .), 'gzip -c -1'], any_args) + subject.dump + end + end +end |