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
Tatuya Kamada
gitlab-ce
Commits
8793025d
Commit
8793025d
authored
Apr 28, 2016
by
James Lopez
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
added spec testing exception raised
parent
ce9310d6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
6 deletions
+21
-6
spec/lib/gitlab/bitbucket_import/client_spec.rb
spec/lib/gitlab/bitbucket_import/client_spec.rb
+21
-6
No files found.
spec/lib/gitlab/bitbucket_import/client_spec.rb
View file @
8793025d
...
@@ -34,18 +34,33 @@ describe Gitlab::BitbucketImport::Client, lib: true do
...
@@ -34,18 +34,33 @@ describe Gitlab::BitbucketImport::Client, lib: true do
it
'retrieves issues over a number of pages'
do
it
'retrieves issues over a number of pages'
do
stub_request
(
:get
,
stub_request
(
:get
,
"https://bitbucket.org/api/1.0/repositories/
#{
project_id
}
/issues?limit=50&sort=utc_created_on&start=0"
).
"https://bitbucket.org/api/1.0/repositories/
#{
project_id
}
/issues?limit=50&sort=utc_created_on&start=0"
).
to_return
(
status:
200
,
to_return
(
status:
200
,
body:
first_sample_data
.
to_json
,
body:
first_sample_data
.
to_json
,
headers:
{})
headers:
{})
stub_request
(
:get
,
stub_request
(
:get
,
"https://bitbucket.org/api/1.0/repositories/
#{
project_id
}
/issues?limit=50&sort=utc_created_on&start=50"
).
"https://bitbucket.org/api/1.0/repositories/
#{
project_id
}
/issues?limit=50&sort=utc_created_on&start=50"
).
to_return
(
status:
200
,
to_return
(
status:
200
,
body:
second_sample_data
.
to_json
,
body:
second_sample_data
.
to_json
,
headers:
{})
headers:
{})
issues
=
client
.
issues
(
project_id
)
issues
=
client
.
issues
(
project_id
)
expect
(
issues
.
count
).
to
eq
(
95
)
expect
(
issues
.
count
).
to
eq
(
95
)
end
end
end
end
context
'project import'
do
it
'calls .from_project with no errors'
do
project
=
create
(
:empty_project
)
project
.
create_or_update_import_data
(
credentials:
{
:user
=>
"git"
,
:password
=>
nil
,
:bb_session
=>
{
:bitbucket_access_token
=>
"test"
,
:bitbucket_access_token_secret
=>
"test"
}
})
project
.
import_url
=
"ssh://git@bitbucket.org/test/test.git"
expect
{
described_class
.
from_project
(
project
)
}.
to_not
raise_error
end
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