Welcome to mirror list, hosted at ThFree Co, Russian Federation.

archive_repository_service_spec.rb « services « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 1cc7b2402168112d5c9079dc92fcc164ecc7abe9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
require 'spec_helper'

describe ArchiveRepositoryService do
  let(:project) { create(:project) }
  subject { ArchiveRepositoryService.new(project, "master", "zip") }

  describe "#execute" do
    it "cleans old archives" do
      expect(project.repository).to receive(:clean_old_archives)

      subject.execute(timeout: 0.0)
    end

    context "when the repository doesn't have an archive file path" do
      before do
        allow(project.repository).to receive(:archive_metadata).and_return(Hash.new)
      end

      it "raises an error" do
        expect { subject.execute(timeout: 0.0) }.to raise_error(RuntimeError)
      end
    end

  end
end