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
5daad7da
Commit
5daad7da
authored
May 22, 2018
by
Rémy Coutable
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reduce CE/EE diff in spec/controllers/projects/imports_controller_spec.rb
Signed-off-by:
Rémy Coutable
<
remy@rymai.me
>
parent
e42d97f5
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
26 deletions
+30
-26
ee/spec/controllers/projects/imports_controller_spec.rb
ee/spec/controllers/projects/imports_controller_spec.rb
+30
-0
spec/controllers/projects/imports_controller_spec.rb
spec/controllers/projects/imports_controller_spec.rb
+0
-26
No files found.
ee/spec/controllers/projects/imports_controller_spec.rb
0 → 100644
View file @
5daad7da
require
'spec_helper'
describe
Projects
::
ImportsController
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:project
)
{
create
(
:project
)
}
before
do
sign_in
(
user
)
project
.
add_master
(
user
)
end
context
'POST #create'
do
context
'mirror user is not the current user'
do
it
'should only assign the current user'
do
allow_any_instance_of
(
EE
::
Project
).
to
receive
(
:add_import_job
)
new_user
=
create
(
:user
)
project
.
add_master
(
new_user
)
post
:create
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
,
project:
{
mirror:
true
,
mirror_user_id:
new_user
.
id
,
import_url:
'http://local.dev'
},
format: :json
expect
(
project
.
reload
.
mirror
).
to
eq
(
true
)
expect
(
project
.
reload
.
mirror_user
.
id
).
to
eq
(
user
.
id
)
end
end
end
end
spec/controllers/projects/imports_controller_spec.rb
View file @
5daad7da
...
...
@@ -11,13 +11,6 @@ describe Projects::ImportsController do
describe
'GET #show'
do
context
'when repository does not exists'
do
let
(
:project
)
{
create
(
:project
)
}
before
do
sign_in
(
user
)
project
.
add_master
(
user
)
end
it
'renders template'
do
get
:show
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
...
...
@@ -126,23 +119,4 @@ describe Projects::ImportsController do
end
end
end
context
'POST #create'
do
context
'mirror user is not the current user'
do
it
'should only assign the current user'
do
allow_any_instance_of
(
EE
::
Project
).
to
receive
(
:add_import_job
)
new_user
=
create
(
:user
)
project
.
add_master
(
new_user
)
post
:create
,
namespace_id:
project
.
namespace
.
to_param
,
project_id:
project
,
project:
{
mirror:
true
,
mirror_user_id:
new_user
.
id
,
import_url:
'http://local.dev'
},
format: :json
expect
(
project
.
reload
.
mirror
).
to
eq
(
true
)
expect
(
project
.
reload
.
mirror_user
.
id
).
to
eq
(
user
.
id
)
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