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
f25d64d4
Commit
f25d64d4
authored
Nov 16, 2016
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove no longer used BitbucketImport::Client spec
parent
ea393e6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
67 deletions
+0
-67
spec/lib/gitlab/bitbucket_import/client_spec.rb
spec/lib/gitlab/bitbucket_import/client_spec.rb
+0
-67
No files found.
spec/lib/gitlab/bitbucket_import/client_spec.rb
deleted
100644 → 0
View file @
ea393e6f
require
'spec_helper'
describe
Gitlab
::
BitbucketImport
::
Client
,
lib:
true
do
include
ImportSpecHelper
let
(
:token
)
{
'123456'
}
let
(
:secret
)
{
'secret'
}
let
(
:client
)
{
Gitlab
::
BitbucketImport
::
Client
.
new
(
token
,
secret
)
}
before
do
stub_omniauth_provider
(
'bitbucket'
)
end
it
'all OAuth client options are symbols'
do
client
.
consumer
.
options
.
keys
.
each
do
|
key
|
expect
(
key
).
to
be_kind_of
(
Symbol
)
end
end
context
'issues'
do
let
(
:per_page
)
{
50
}
let
(
:count
)
{
95
}
let
(
:sample_issues
)
do
issues
=
[]
count
.
times
do
|
i
|
issues
<<
{
local_id:
i
}
end
issues
end
let
(
:first_sample_data
)
{
{
count:
count
,
issues:
sample_issues
[
0
..
per_page
-
1
]
}
}
let
(
:second_sample_data
)
{
{
count:
count
,
issues:
sample_issues
[
per_page
..
count
]
}
}
let
(
:project_id
)
{
'namespace/repo'
}
it
'retrieves issues over a number of pages'
do
stub_request
(
:get
,
"https://bitbucket.org/api/1.0/repositories/
#{
project_id
}
/issues?limit=50&sort=utc_created_on&start=0"
).
to_return
(
status:
200
,
body:
first_sample_data
.
to_json
,
headers:
{})
stub_request
(
:get
,
"https://bitbucket.org/api/1.0/repositories/
#{
project_id
}
/issues?limit=50&sort=utc_created_on&start=50"
).
to_return
(
status:
200
,
body:
second_sample_data
.
to_json
,
headers:
{})
issues
=
client
.
issues
(
project_id
)
expect
(
issues
.
count
).
to
eq
(
95
)
end
end
context
'project import'
do
it
'calls .from_project with no errors'
do
project
=
create
(
:empty_project
)
project
.
import_url
=
"ssh://git@bitbucket.org/test/test.git"
project
.
create_or_update_import_data
(
credentials:
{
user:
"git"
,
password:
nil
,
bb_session:
{
bitbucket_access_token:
"test"
,
bitbucket_access_token_secret:
"test"
}
})
expect
{
described_class
.
from_project
(
project
)
}.
not_to
raise_error
end
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