BigW Consortium Gitlab

repo_saver_spec.rb 798 Bytes
Newer Older
1 2
require 'spec_helper'

3
describe Gitlab::ImportExport::RepoSaver, services: true do
4
  describe 'bundle a project Git repo' do
5
    let(:user) { create(:user) }
6
    let!(:project) { create(:empty_project, :public, name: 'searchable_project') }
7
    let(:export_path) { "#{Dir.tmpdir}/project_tree_saver_spec" }
8
    let(:shared) { Gitlab::ImportExport::Shared.new(relative_path: project.path_with_namespace) }
9
    let(:bundler) { described_class.new(project: project, shared: shared) }
10

11
    before do
12
      project.team << [user, :master]
13
      allow_any_instance_of(Gitlab::ImportExport).to receive(:storage_path).and_return(export_path)
14 15
    end

16
    after do
17 18 19 20
      FileUtils.rm_rf(export_path)
    end

    it 'bundles the repo successfully' do
21
      expect(bundler.save).to be true
22 23 24
    end
  end
end