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
d6db6dda
Commit
d6db6dda
authored
Oct 28, 2014
by
Dmitriy Zaporozhets
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of dev.gitlab.org:gitlab/gitlabhq
parents
fa398636
1ad78be9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
11 deletions
+9
-11
spec/services/projects/transfer_service_spec.rb
spec/services/projects/transfer_service_spec.rb
+9
-11
No files found.
spec/services/projects/transfer_service_spec.rb
View file @
d6db6dda
...
...
@@ -3,15 +3,12 @@ require 'spec_helper'
describe
Projects
::
TransferService
do
let
(
:user
)
{
create
(
:user
)
}
let
(
:group
)
{
create
(
:group
)
}
let
(
:group2
)
{
create
(
:group
)
}
let
(
:project
)
{
create
(
:project
,
namespace:
user
.
namespace
)
}
context
'namespace -> namespace'
do
before
do
group
.
add_owner
(
user
)
@service
=
Projects
::
TransferService
.
new
(
project
,
user
,
namespace_id:
group
.
id
)
@service
.
gitlab_shell
.
stub
(
mv_repository:
true
)
@result
=
@service
.
execute
@result
=
transfer_project
(
project
,
user
,
namespace_id:
group
.
id
)
end
it
{
@result
.
should
be_true
}
...
...
@@ -20,24 +17,25 @@ describe Projects::TransferService do
context
'namespace -> no namespace'
do
before
do
group
.
add_owner
(
user
)
@service
=
Projects
::
TransferService
.
new
(
project
,
user
,
namespace_id:
nil
)
@service
.
gitlab_shell
.
stub
(
mv_repository:
true
)
@result
=
@service
.
execute
@result
=
transfer_project
(
project
,
user
,
namespace_id:
nil
)
end
it
{
@result
.
should_not
be_nil
}
# { result.should be_false } passes on nil
it
{
@result
.
should
be_false
}
it
{
project
.
namespace
.
should
==
user
.
namespace
}
end
context
'namespace -> not allowed namespace'
do
before
do
@service
=
Projects
::
TransferService
.
new
(
project
,
user
,
namespace_id:
group2
.
id
)
@service
.
gitlab_shell
.
stub
(
mv_repository:
true
)
@result
=
@service
.
execute
@result
=
transfer_project
(
project
,
user
,
namespace_id:
group
.
id
)
end
it
{
@result
.
should_not
be_nil
}
# { result.should be_false } passes on nil
it
{
@result
.
should
be_false
}
it
{
project
.
namespace
.
should
==
user
.
namespace
}
end
def
transfer_project
(
project
,
user
,
params
)
Projects
::
TransferService
.
new
(
project
,
user
,
params
).
execute
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