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

client_spec.rb « google_code_import « gitlab « lib « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d2bf871daa8bd1133375669d7a6e53c61258490d (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
26
27
28
29
30
31
32
33
34
require "spec_helper"

describe Gitlab::GoogleCodeImport::Client do
  let(:raw_data) { JSON.parse(File.read(Rails.root.join("spec/fixtures/GoogleCodeProjectHosting.json"))) }
  subject { described_class.new(raw_data) }

  describe "#valid?" do
    context "when the data is valid" do
      it "returns true" do
        expect(subject).to be_valid
      end
    end

    context "when the data is invalid" do
      let(:raw_data) { "No clue" }

      it "returns true" do
        expect(subject).to_not be_valid
      end
    end
  end

  describe "#repos" do
    it "returns only Git repositories" do
      expect(subject.repos.length).to eq(1)
    end
  end

  describe "#repo" do
    it "returns the referenced repository" do
      expect(subject.repo("tint2").name).to eq("tint2")
    end
  end
end