summaryrefslogtreecommitdiff
path: root/spec/controllers
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-03-12 17:13:25 +0000
committerDmitriy Zaporozhets <dzaporozhets@gitlab.com>2015-03-12 17:13:25 +0000
commit1065f3d30b0d793fc0b944cc9d19c8e9858ae08a (patch)
treeb57bd1c500e27893729104f3ef69cbc5e7cb7dff /spec/controllers
parent59621e90343789a8d45326814e8dc85c79390369 (diff)
parent3175438f02ca4bc0469aca097e02b2671865ef43 (diff)
downloadgitlab-ce-1065f3d30b0d793fc0b944cc9d19c8e9858ae08a.tar.gz
Merge branch 'github-org-repos' into 'master'
Fix missing GitHub organisation repositories on import page. Private repositories belonging to organizations rather than users can't be imported because `client.repos(org.login)` was requesting `/users/:org_login/repos` (which only returns public org repo's), while we need `/orgs/:org_login/repos` (which includes both public and private). The `client.org_repos` method does this. cc @marin This is a bug in 7.8.x, but I'm not sure if it needs a minor release now or if it can go in 7.9. See merge request !1683
Diffstat (limited to 'spec/controllers')
-rw-r--r--spec/controllers/import/github_controller_spec.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/spec/controllers/import/github_controller_spec.rb b/spec/controllers/import/github_controller_spec.rb
index b8820413406..5b967bfcc0c 100644
--- a/spec/controllers/import/github_controller_spec.rb
+++ b/spec/controllers/import/github_controller_spec.rb
@@ -27,17 +27,20 @@ describe Import::GithubController do
describe "GET status" do
before do
@repo = OpenStruct.new(login: 'vim', full_name: 'asd/vim')
+ @org = OpenStruct.new(login: 'company')
+ @org_repo = OpenStruct.new(login: 'company', full_name: 'company/repo')
end
it "assigns variables" do
@project = create(:project, import_type: 'github', creator_id: user.id)
controller.stub_chain(:client, :repos).and_return([@repo])
- controller.stub_chain(:client, :orgs).and_return([])
+ controller.stub_chain(:client, :orgs).and_return([@org])
+ controller.stub_chain(:client, :org_repos).with(@org.login).and_return([@org_repo])
get :status
expect(assigns(:already_added_projects)).to eq([@project])
- expect(assigns(:repos)).to eq([@repo])
+ expect(assigns(:repos)).to eq([@repo, @org_repo])
end
it "does not show already added project" do