Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Boxiang Sun
gitlab-ce
Commits
3175438f
Commit
3175438f
authored
Mar 12, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix missing GitHub organisation repositories on import page.
parent
82bb3ec3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
3 deletions
+7
-3
CHANGELOG
CHANGELOG
+1
-0
app/controllers/import/github_controller.rb
app/controllers/import/github_controller.rb
+1
-1
spec/controllers/import/github_controller_spec.rb
spec/controllers/import/github_controller_spec.rb
+5
-2
No files found.
CHANGELOG
View file @
3175438f
...
@@ -44,6 +44,7 @@ v 7.9.0 (unreleased)
...
@@ -44,6 +44,7 @@ v 7.9.0 (unreleased)
- Wrap commit message in EmailsOnPush email.
- Wrap commit message in EmailsOnPush email.
- Send EmailsOnPush emails when deleting commits using force push.
- Send EmailsOnPush emails when deleting commits using force push.
- Fix EmailsOnPush email comparison link to include first commit.
- Fix EmailsOnPush email comparison link to include first commit.
- Fix missing GitHub organisation repositories on import page.
v 7.8.2
v 7.8.2
- Fix service migration issue when upgrading from versions prior to 7.3
- Fix service migration issue when upgrading from versions prior to 7.3
...
...
app/controllers/import/github_controller.rb
View file @
3175438f
...
@@ -14,7 +14,7 @@ class Import::GithubController < Import::BaseController
...
@@ -14,7 +14,7 @@ class Import::GithubController < Import::BaseController
def
status
def
status
@repos
=
client
.
repos
@repos
=
client
.
repos
client
.
orgs
.
each
do
|
org
|
client
.
orgs
.
each
do
|
org
|
@repos
+=
client
.
repos
(
org
.
login
)
@repos
+=
client
.
org_
repos
(
org
.
login
)
end
end
@already_added_projects
=
current_user
.
created_projects
.
where
(
import_type:
"github"
)
@already_added_projects
=
current_user
.
created_projects
.
where
(
import_type:
"github"
)
...
...
spec/controllers/import/github_controller_spec.rb
View file @
3175438f
...
@@ -27,17 +27,20 @@ describe Import::GithubController do
...
@@ -27,17 +27,20 @@ describe Import::GithubController do
describe
"GET status"
do
describe
"GET status"
do
before
do
before
do
@repo
=
OpenStruct
.
new
(
login:
'vim'
,
full_name:
'asd/vim'
)
@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
end
it
"assigns variables"
do
it
"assigns variables"
do
@project
=
create
(
:project
,
import_type:
'github'
,
creator_id:
user
.
id
)
@project
=
create
(
:project
,
import_type:
'github'
,
creator_id:
user
.
id
)
controller
.
stub_chain
(
:client
,
:repos
).
and_return
([
@repo
])
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
get
:status
expect
(
assigns
(
:already_added_projects
)).
to
eq
([
@project
])
expect
(
assigns
(
:already_added_projects
)).
to
eq
([
@project
])
expect
(
assigns
(
:repos
)).
to
eq
([
@repo
])
expect
(
assigns
(
:repos
)).
to
eq
([
@repo
,
@org_repo
])
end
end
it
"does not show already added project"
do
it
"does not show already added project"
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment