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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-04-03 16:29:27 +0300
committerDouwe Maan <douwe@gitlab.com>2015-04-03 16:29:27 +0300
commit7b5bc32cadbf2c0a3ac1e80643e46786fd8b1b56 (patch)
tree0dfa9add1156d8ce9ff8709e36da577b7c94ad1c /spec/lib/gitlab/google_code_import/client_spec.rb
parent9157985cfce1391973673ea278dc7506a90f8f53 (diff)
Allow projects to be imported from Google Code.
Diffstat (limited to 'spec/lib/gitlab/google_code_import/client_spec.rb')
-rw-r--r--spec/lib/gitlab/google_code_import/client_spec.rb34
1 files changed, 34 insertions, 0 deletions
diff --git a/spec/lib/gitlab/google_code_import/client_spec.rb b/spec/lib/gitlab/google_code_import/client_spec.rb
new file mode 100644
index 00000000000..d2bf871daa8
--- /dev/null
+++ b/spec/lib/gitlab/google_code_import/client_spec.rb
@@ -0,0 +1,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