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
c756e62b
Commit
c756e62b
authored
Dec 14, 2016
by
Valery Sizov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
BB importer: fix specs
parent
6bbe2f11
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
15 additions
and
12 deletions
+15
-12
connection_spec.rb
spec/lib/bitbucket/connection_spec.rb
+4
-0
comment_spec.rb
spec/lib/bitbucket/representation/comment_spec.rb
+1
-1
issue_spec.rb
spec/lib/bitbucket/representation/issue_spec.rb
+3
-3
pull_request_comment_spec.rb
...lib/bitbucket/representation/pull_request_comment_spec.rb
+1
-2
pull_request_spec.rb
spec/lib/bitbucket/representation/pull_request_spec.rb
+2
-2
importer_spec.rb
spec/lib/gitlab/bitbucket_import/importer_spec.rb
+4
-4
No files found.
spec/lib/bitbucket/connection_spec.rb
View file @
c756e62b
require
'spec_helper'
describe
Bitbucket
::
Connection
do
before
do
allow_any_instance_of
(
described_class
).
to
receive
(
:provider
).
and_return
(
double
(
app_id:
''
,
app_secret:
''
))
end
describe
'#get'
do
it
'calls OAuth2::AccessToken::get'
do
expect_any_instance_of
(
OAuth2
::
AccessToken
).
to
receive
(
:get
).
and_return
(
double
(
parsed:
true
))
...
...
spec/lib/bitbucket/representation/comment_spec.rb
View file @
c756e62b
...
...
@@ -3,7 +3,7 @@ require 'spec_helper'
describe
Bitbucket
::
Representation
::
Comment
do
describe
'#author'
do
it
{
expect
(
described_class
.
new
(
'user'
=>
{
'username'
=>
'Ben'
}).
author
).
to
eq
(
'Ben'
)
}
it
{
expect
(
described_class
.
new
({}).
author
).
to
eq
(
'Anonymous'
)
}
it
{
expect
(
described_class
.
new
({}).
author
).
to
be_nil
}
end
describe
'#note'
do
...
...
spec/lib/bitbucket/representation/issue_spec.rb
View file @
c756e62b
...
...
@@ -10,12 +10,12 @@ describe Bitbucket::Representation::Issue do
end
describe
'#author'
do
it
{
expect
(
described_class
.
new
({
'reporter'
=>
{
'username'
=>
'Ben'
}}).
author
).
to
eq
(
'Ben'
)
}
it
{
expect
(
described_class
.
new
({}).
author
).
to
eq
(
'Anonymous'
)
}
it
{
expect
(
described_class
.
new
({
'reporter'
=>
{
'username'
=>
'Ben'
}
}).
author
).
to
eq
(
'Ben'
)
}
it
{
expect
(
described_class
.
new
({}).
author
).
to
be_nil
}
end
describe
'#description'
do
it
{
expect
(
described_class
.
new
({
'content'
=>
{
'raw'
=>
'Text'
}}).
description
).
to
eq
(
'Text'
)
}
it
{
expect
(
described_class
.
new
({
'content'
=>
{
'raw'
=>
'Text'
}
}).
description
).
to
eq
(
'Text'
)
}
it
{
expect
(
described_class
.
new
({}).
description
).
to
be_nil
}
end
...
...
spec/lib/bitbucket/representation/pull_request_comment_spec.rb
View file @
c756e62b
...
...
@@ -17,9 +17,8 @@ describe Bitbucket::Representation::PullRequestComment do
it
{
expect
(
described_class
.
new
(
'inline'
=>
{
'to'
=>
3
}).
new_pos
).
to
eq
(
3
)
}
end
describe
'#parent_id'
do
it
{
expect
(
described_class
.
new
({
'parent'
=>
{
'id'
=>
2
}}).
parent_id
).
to
eq
(
2
)
}
it
{
expect
(
described_class
.
new
({
'parent'
=>
{
'id'
=>
2
}
}).
parent_id
).
to
eq
(
2
)
}
it
{
expect
(
described_class
.
new
({}).
parent_id
).
to
be_nil
}
end
...
...
spec/lib/bitbucket/representation/pull_request_spec.rb
View file @
c756e62b
...
...
@@ -6,8 +6,8 @@ describe Bitbucket::Representation::PullRequest do
end
describe
'#author'
do
it
{
expect
(
described_class
.
new
({
'author'
=>
{
'username'
=>
'Ben'
}}).
author
).
to
eq
(
'Ben'
)
}
it
{
expect
(
described_class
.
new
({}).
author
).
to
eq
(
'Anonymous'
)
}
it
{
expect
(
described_class
.
new
({
'author'
=>
{
'username'
=>
'Ben'
}
}).
author
).
to
eq
(
'Ben'
)
}
it
{
expect
(
described_class
.
new
({}).
author
).
to
be_nil
}
end
describe
'#description'
do
...
...
spec/lib/gitlab/bitbucket_import/importer_spec.rb
View file @
c756e62b
...
...
@@ -84,10 +84,10 @@ describe Gitlab::BitbucketImport::Importer, lib: true do
body:
issues_statuses_sample_data
.
to_json
)
stub_request
(
:get
,
"https://api.bitbucket.org/2.0/repositories/namespace/repo?pagelen=50&sort=created_on"
).
with
(
:headers
=>
{
'Accept'
=>
'*/*'
,
'Accept-Encoding'
=>
'gzip;q=1.0,deflate;q=0.6,identity;q=0.3'
,
'Authorization'
=>
'Bearer'
,
'User-Agent'
=>
'Faraday v0.9.2'
}).
to_return
(
:status
=>
200
,
:body
=>
""
,
:headers
=>
{})
with
(
headers:
{
'Accept'
=>
'*/*'
,
'Accept-Encoding'
=>
'gzip;q=1.0,deflate;q=0.6,identity;q=0.3'
,
'Authorization'
=>
'Bearer'
,
'User-Agent'
=>
'Faraday v0.9.2'
}).
to_return
(
status:
200
,
body:
""
,
headers:
{})
sample_issues_statuses
.
each_with_index
do
|
issue
,
index
|
stub_request
(
...
...
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