diff options
author | Stan Hu <stanhu@gmail.com> | 2015-04-29 00:33:49 -0700 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2015-04-30 06:56:49 -0700 |
commit | 9c76a6fa96bd3c48dc1a64aecb082d4bd87dc2ba (patch) | |
tree | 9f566f5e900de491b2a382489e3eebdb567c224c /spec | |
parent | 39a55bdf1a1613f362bcd7da444b291210454160 (diff) | |
download | gitlab-ce-9c76a6fa96bd3c48dc1a64aecb082d4bd87dc2ba.tar.gz |
Show incompatible projects in Google Code import status
Importing a JSON file with only one Subversion project lead to confusion
over whether the system was working. Provide status why these projects
could not be imported directly.
Closes #1531
Diffstat (limited to 'spec')
-rw-r--r-- | spec/controllers/import/google_code_controller_spec.rb | 13 | ||||
-rw-r--r-- | spec/lib/gitlab/google_code_import/client_spec.rb | 1 |
2 files changed, 14 insertions, 0 deletions
diff --git a/spec/controllers/import/google_code_controller_spec.rb b/spec/controllers/import/google_code_controller_spec.rb index 037cddb4600..78c0f5079cc 100644 --- a/spec/controllers/import/google_code_controller_spec.rb +++ b/spec/controllers/import/google_code_controller_spec.rb @@ -27,21 +27,34 @@ describe Import::GoogleCodeController do it "assigns variables" do @project = create(:project, import_type: 'google_code', creator_id: user.id) controller.stub_chain(:client, :repos).and_return([@repo]) + controller.stub_chain(:client, :incompatible_repos).and_return([]) get :status expect(assigns(:already_added_projects)).to eq([@project]) expect(assigns(:repos)).to eq([@repo]) + expect(assigns(:incompatible_repos)).to eq([]) end it "does not show already added project" do @project = create(:project, import_type: 'google_code', creator_id: user.id, import_source: 'vim') controller.stub_chain(:client, :repos).and_return([@repo]) + controller.stub_chain(:client, :incompatible_repos).and_return([]) get :status expect(assigns(:already_added_projects)).to eq([@project]) expect(assigns(:repos)).to eq([]) end + + it "does not show any invalid projects" do + controller.stub_chain(:client, :repos).and_return([]) + controller.stub_chain(:client, :incompatible_repos).and_return([@repo]) + + get :status + + expect(assigns(:repos)).to be_empty + expect(assigns(:incompatible_repos)).to eq([@repo]) + end end end diff --git a/spec/lib/gitlab/google_code_import/client_spec.rb b/spec/lib/gitlab/google_code_import/client_spec.rb index d2bf871daa8..a66b811e0fd 100644 --- a/spec/lib/gitlab/google_code_import/client_spec.rb +++ b/spec/lib/gitlab/google_code_import/client_spec.rb @@ -23,6 +23,7 @@ describe Gitlab::GoogleCodeImport::Client do describe "#repos" do it "returns only Git repositories" do expect(subject.repos.length).to eq(1) + expect(subject.incompatible_repos.length).to eq(1) end end |