2015-04-26 12:48:37 +05:30
|
|
|
require "spec_helper"
|
|
|
|
|
2017-09-10 17:25:29 +05:30
|
|
|
describe Gitlab::GoogleCodeImport::Client do
|
2015-09-25 12:07:36 +05:30
|
|
|
let(:raw_data) { JSON.parse(fixture_file("GoogleCodeProjectHosting.json")) }
|
2015-04-26 12:48:37 +05:30
|
|
|
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
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(subject).not_to be_valid
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "#repos" do
|
|
|
|
it "returns only Git repositories" do
|
|
|
|
expect(subject.repos.length).to eq(1)
|
2015-09-11 14:41:01 +05:30
|
|
|
expect(subject.incompatible_repos.length).to eq(1)
|
2015-04-26 12:48:37 +05:30
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
describe "#repo" do
|
|
|
|
it "returns the referenced repository" do
|
|
|
|
expect(subject.repo("tint2").name).to eq("tint2")
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|