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
iv
gitlab-ce
Commits
2d544d54
Commit
2d544d54
authored
Mar 30, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
spec and fix for fogbugz lonely user problem
parent
3d484861
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
lib/gitlab/fogbugz_import/client.rb
lib/gitlab/fogbugz_import/client.rb
+1
-1
spec/lib/gitlab/fogbugz_import/client_spec.rb
spec/lib/gitlab/fogbugz_import/client_spec.rb
+24
-0
No files found.
lib/gitlab/fogbugz_import/client.rb
View file @
2d544d54
...
...
@@ -26,7 +26,7 @@ module Gitlab
def
user_map
users
=
{}
res
=
@api
.
command
(
:listPeople
)
res
[
'people'
][
'person'
]
.
each
do
|
user
|
[
res
[
'people'
][
'person'
]].
flatten
.
each
do
|
user
|
users
[
user
[
'ixPerson'
]]
=
{
name:
user
[
'sFullName'
],
email:
user
[
'sEmail'
]
}
end
users
...
...
spec/lib/gitlab/fogbugz_import/client_spec.rb
0 → 100644
View file @
2d544d54
require
'spec_helper'
describe
Gitlab
::
FogbugzImport
::
Client
,
lib:
true
do
let
(
:client
)
{
Gitlab
::
FogbugzImport
::
Client
.
new
(
uri:
''
,
token:
''
)
}
let
(
:one_user
)
{
{
'people'
=>
{
'person'
=>
{
"ixPerson"
=>
"2"
,
"sFullName"
=>
"James"
}
}
}
}
let
(
:two_users
)
{
{
'people'
=>
{
'person'
=>
[
one_user
,
{
"ixPerson"
=>
"3"
}]
}
}
}
it
'retrieves user_map with one user'
do
stub_api
(
one_user
)
expect
(
client
.
user_map
.
count
).
to
eq
(
1
)
end
it
'retrieves user_map with two users'
do
stub_api
(
two_users
)
expect
(
client
.
user_map
.
count
).
to
eq
(
2
)
end
def
stub_api
(
users
)
allow_any_instance_of
(
::
Fogbugz
::
Interface
).
to
receive
(
:command
).
with
(
:listPeople
).
and_return
(
users
)
end
end
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