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
1e4d2c81
Commit
1e4d2c81
authored
Aug 13, 2020
by
Illya Klymov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove useless rubocop disable
parent
37fbda6f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
12 deletions
+0
-12
spec/controllers/import/bitbucket_server_controller_spec.rb
spec/controllers/import/bitbucket_server_controller_spec.rb
+0
-12
No files found.
spec/controllers/import/bitbucket_server_controller_spec.rb
View file @
1e4d2c81
...
...
@@ -33,18 +33,15 @@ RSpec.describe Import::BitbucketServerController do
describe
'POST create'
do
let
(
:project_name
)
{
"my-project_123"
}
# rubocop: disable CodeReuse/ActiveRecord
before
do
allow
(
controller
).
to
receive
(
:client
).
and_return
(
client
)
repo
=
double
(
name:
project_name
)
allow
(
client
).
to
receive
(
:repo
).
with
(
project_key
,
repo_slug
).
and_return
(
repo
)
assign_session_tokens
end
# rubocop: enable CodeReuse/ActiveRecord
let_it_be
(
:project
)
{
create
(
:project
)
}
# rubocop: disable CodeReuse/ActiveRecord
it
'returns the new project'
do
allow
(
Gitlab
::
BitbucketServerImport
::
ProjectCreator
)
.
to
receive
(
:new
).
with
(
project_key
,
repo_slug
,
anything
,
project_name
,
user
.
namespace
,
user
,
anything
)
...
...
@@ -54,12 +51,10 @@ RSpec.describe Import::BitbucketServerController do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
# rubocop: enable CodeReuse/ActiveRecord
context
'with project key with tildes'
do
let
(
:project_key
)
{
'~someuser_123'
}
# rubocop: disable CodeReuse/ActiveRecord
it
'successfully creates a project'
do
allow
(
Gitlab
::
BitbucketServerImport
::
ProjectCreator
)
.
to
receive
(
:new
).
with
(
project_key
,
repo_slug
,
anything
,
project_name
,
user
.
namespace
,
user
,
anything
)
...
...
@@ -69,7 +64,6 @@ RSpec.describe Import::BitbucketServerController do
expect
(
response
).
to
have_gitlab_http_status
(
:ok
)
end
# rubocop: enable CodeReuse/ActiveRecord
end
it
'returns an error when an invalid project key is used'
do
...
...
@@ -84,7 +78,6 @@ RSpec.describe Import::BitbucketServerController do
expect
(
response
).
to
have_gitlab_http_status
(
:unprocessable_entity
)
end
# rubocop: disable CodeReuse/ActiveRecord
it
'returns an error when the project cannot be found'
do
allow
(
client
).
to
receive
(
:repo
).
with
(
project_key
,
repo_slug
).
and_return
(
nil
)
...
...
@@ -92,9 +85,7 @@ RSpec.describe Import::BitbucketServerController do
expect
(
response
).
to
have_gitlab_http_status
(
:unprocessable_entity
)
end
# rubocop: enable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
it
'returns an error when the project cannot be saved'
do
allow
(
Gitlab
::
BitbucketServerImport
::
ProjectCreator
)
.
to
receive
(
:new
).
with
(
project_key
,
repo_slug
,
anything
,
project_name
,
user
.
namespace
,
user
,
anything
)
...
...
@@ -104,9 +95,7 @@ RSpec.describe Import::BitbucketServerController do
expect
(
response
).
to
have_gitlab_http_status
(
:unprocessable_entity
)
end
# rubocop: enable CodeReuse/ActiveRecord
# rubocop: disable CodeReuse/ActiveRecord
it
"returns an error when the server can't be contacted"
do
allow
(
client
).
to
receive
(
:repo
).
with
(
project_key
,
repo_slug
).
and_raise
(
::
BitbucketServer
::
Connection
::
ConnectionError
)
...
...
@@ -114,7 +103,6 @@ RSpec.describe Import::BitbucketServerController do
expect
(
response
).
to
have_gitlab_http_status
(
:unprocessable_entity
)
end
# rubocop: enable CodeReuse/ActiveRecord
it_behaves_like
'project import rate limiter'
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