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
1d03ff93
Commit
1d03ff93
authored
Jul 15, 2018
by
Stan Hu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add first rev of Bitbucket Server importer test
parent
81c8c98e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
44 additions
and
0 deletions
+44
-0
app/models/project.rb
app/models/project.rb
+2
-0
spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
+42
-0
No files found.
app/models/project.rb
View file @
1d03ff93
...
...
@@ -640,6 +640,8 @@ class Project < ActiveRecord::Base
project_import_data
.
credentials
||=
{}
project_import_data
.
credentials
=
project_import_data
.
credentials
.
merge
(
credentials
)
end
project_import_data
end
def
import?
...
...
spec/lib/gitlab/bitbucket_server_import/importer_spec.rb
0 → 100644
View file @
1d03ff93
require
'spec_helper'
describe
Gitlab
::
BitbucketServerImport
::
Importer
do
include
ImportSpecHelper
let
(
:project
)
{
create
(
:project
,
import_url:
'http://my-bitbucket'
)
}
subject
{
described_class
.
new
(
project
)
}
before
do
data
=
project
.
create_or_update_import_data
(
data:
{
project_key:
'TEST'
,
repo_slug:
'rouge'
},
credentials:
{
base_uri:
'http://my-bitbucket'
,
user:
'bitbucket'
,
password:
'test'
}
)
data
.
save
project
.
save
end
describe
'#import_repository'
do
before
do
expect
(
subject
).
to
receive
(
:import_pull_requests
)
expect
(
subject
).
to
receive
(
:delete_temp_branches
)
end
it
'adds a remote'
do
expect
(
project
.
repository
).
to
receive
(
:fetch_as_mirror
)
.
with
(
'http://bitbucket:test@my-bitbucket'
,
refmap:
[
:heads
,
:tags
,
'+refs/pull-requests/*/to:refs/merge-requests/*/head'
],
remote_name:
'bitbucket_server'
)
subject
.
execute
end
end
describe
'#import_pull_requests'
do
end
describe
'#delete_temp_branches'
do
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