BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
fc40c3f2
Commit
fc40c3f2
authored
Nov 21, 2016
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix Rubocop errors with Bitbucket Importer spec
parent
402cc95c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
importer_spec.rb
spec/lib/gitlab/bitbucket_import/importer_spec.rb
+7
-7
No files found.
spec/lib/gitlab/bitbucket_import/importer_spec.rb
View file @
fc40c3f2
...
@@ -67,14 +67,14 @@ describe Gitlab::BitbucketImport::Importer, lib: true do
...
@@ -67,14 +67,14 @@ describe Gitlab::BitbucketImport::Importer, lib: true do
:get
,
:get
,
"https://api.bitbucket.org/2.0/repositories/
#{
project_identifier
}
"
"https://api.bitbucket.org/2.0/repositories/
#{
project_identifier
}
"
).
to_return
(
status:
200
,
).
to_return
(
status:
200
,
headers:
{
"Content-Type"
=>
"application/json"
},
headers:
{
"Content-Type"
=>
"application/json"
},
body:
{
has_issues:
true
,
full_name:
project_identifier
}.
to_json
)
body:
{
has_issues:
true
,
full_name:
project_identifier
}.
to_json
)
stub_request
(
stub_request
(
:get
,
:get
,
"https://api.bitbucket.org/2.0/repositories/
#{
project_identifier
}
/issues?pagelen=50&sort=created_on"
"https://api.bitbucket.org/2.0/repositories/
#{
project_identifier
}
/issues?pagelen=50&sort=created_on"
).
to_return
(
status:
200
,
).
to_return
(
status:
200
,
headers:
{
"Content-Type"
=>
"application/json"
},
headers:
{
"Content-Type"
=>
"application/json"
},
body:
issues_statuses_sample_data
.
to_json
)
body:
issues_statuses_sample_data
.
to_json
)
sample_issues_statuses
.
each_with_index
do
|
issue
,
index
|
sample_issues_statuses
.
each_with_index
do
|
issue
,
index
|
...
@@ -83,22 +83,22 @@ describe Gitlab::BitbucketImport::Importer, lib: true do
...
@@ -83,22 +83,22 @@ describe Gitlab::BitbucketImport::Importer, lib: true do
"https://api.bitbucket.org/2.0/repositories/
#{
project_identifier
}
/issues/
#{
issue
[
:id
]
}
/comments?pagelen=50&sort=created_on"
"https://api.bitbucket.org/2.0/repositories/
#{
project_identifier
}
/issues/
#{
issue
[
:id
]
}
/comments?pagelen=50&sort=created_on"
).
to_return
(
).
to_return
(
status:
200
,
status:
200
,
headers:
{
"Content-Type"
=>
"application/json"
},
headers:
{
"Content-Type"
=>
"application/json"
},
body:
{
author_info:
{
username:
"username"
},
utc_created_on:
index
}.
to_json
body:
{
author_info:
{
username:
"username"
},
utc_created_on:
index
}.
to_json
)
)
end
end
stub_request
(
stub_request
(
:get
,
:get
,
"https://api.bitbucket.org/2.0/repositories/
#{
project_identifier
}
/pullrequests?pagelen=50&sort=created_on&state=ALL"
"https://api.bitbucket.org/2.0/repositories/
#{
project_identifier
}
/pullrequests?pagelen=50&sort=created_on&state=ALL"
).
to_return
(
status:
200
,
).
to_return
(
status:
200
,
headers:
{
"Content-Type"
=>
"application/json"
},
headers:
{
"Content-Type"
=>
"application/json"
},
body:
{}.
to_json
)
body:
{}.
to_json
)
end
end
it
'map statuses to open or closed'
do
it
'map statuses to open or closed'
do
# HACK: Bitbucket::Representation.const_get('Issue') seems to return Issue without this
# HACK: Bitbucket::Representation.const_get('Issue') seems to return Issue without this
Bitbucket
::
Representation
::
Issue
Bitbucket
::
Representation
::
Issue
.
new
importer
.
execute
importer
.
execute
expect
(
project
.
issues
.
where
(
state:
"closed"
).
size
).
to
eq
(
5
)
expect
(
project
.
issues
.
where
(
state:
"closed"
).
size
).
to
eq
(
5
)
...
...
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