summaryrefslogtreecommitdiff
path: root/spec/controllers/import/google_code_controller_spec.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2015-04-29 00:33:49 -0700
committerStan Hu <stanhu@gmail.com>2015-04-30 06:56:49 -0700
commit9c76a6fa96bd3c48dc1a64aecb082d4bd87dc2ba (patch)
tree9f566f5e900de491b2a382489e3eebdb567c224c /spec/controllers/import/google_code_controller_spec.rb
parent39a55bdf1a1613f362bcd7da444b291210454160 (diff)
downloadgitlab-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/controllers/import/google_code_controller_spec.rb')
-rw-r--r--spec/controllers/import/google_code_controller_spec.rb13
1 files changed, 13 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