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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
4e64ca44
Commit
4e64ca44
authored
Aug 06, 2019
by
George Koltsov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add BitbucketServerController filtering spec
parent
13adfb3e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
2 deletions
+14
-2
changelogs/unreleased/georgekoltsov-51260-add-filtering-to-bitbucket-server-import.yml
...oltsov-51260-add-filtering-to-bitbucket-server-import.yml
+1
-1
spec/controllers/import/bitbucket_server_controller_spec.rb
spec/controllers/import/bitbucket_server_controller_spec.rb
+13
-1
No files found.
changelogs/unreleased/georgekoltsov-51260-add-filtering-to-bitbucket-server-import.yml
View file @
4e64ca44
---
title
:
Add BitBucket project import filtering
title
:
Add BitBucket
Server
project import filtering
merge_request
:
31420
author
:
type
:
added
spec/controllers/import/bitbucket_server_controller_spec.rb
View file @
4e64ca44
...
...
@@ -134,6 +134,8 @@ describe Import::BitbucketServerController do
describe
'GET status'
do
render_views
let
(
:repos
)
{
instance_double
(
BitbucketServer
::
Collection
)
}
before
do
allow
(
controller
).
to
receive
(
:bitbucket_client
).
and_return
(
client
)
...
...
@@ -145,7 +147,6 @@ describe Import::BitbucketServerController do
it
'assigns repository categories'
do
created_project
=
create
(
:project
,
:import_finished
,
import_type:
'bitbucket_server'
,
creator_id:
user
.
id
,
import_source:
@created_repo
.
browse_url
)
repos
=
instance_double
(
BitbucketServer
::
Collection
)
expect
(
repos
).
to
receive
(
:partition
).
and_return
([[
@repo
,
@created_repo
],
[
@invalid_repo
]])
expect
(
repos
).
to
receive
(
:current_page
).
and_return
(
1
)
...
...
@@ -159,6 +160,17 @@ describe Import::BitbucketServerController do
expect
(
assigns
(
:repos
)).
to
eq
([
@repo
])
expect
(
assigns
(
:incompatible_repos
)).
to
eq
([
@invalid_repo
])
end
context
'when filtering'
do
let
(
:filter
)
{
'test'
}
it
'passes filter param to bitbucket client'
do
expect
(
repos
).
to
receive
(
:partition
).
and_return
([[
@repo
,
@created_repo
],
[
@invalid_repo
]])
expect
(
client
).
to
receive
(
:repos
).
with
(
filter:
filter
,
limit:
25
,
page_offset:
0
).
and_return
(
repos
)
get
:status
,
params:
{
filter:
filter
},
as: :json
end
end
end
describe
'GET jobs'
do
...
...
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