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
Kazuhiko Shiozaki
gitlab-ce
Commits
d0ec2882
Commit
d0ec2882
authored
Nov 12, 2015
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix specs
parent
5e8ddd3c
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
5 additions
and
14 deletions
+5
-14
features/steps/dashboard/new_project.rb
features/steps/dashboard/new_project.rb
+0
-1
spec/services/projects/fork_service_spec.rb
spec/services/projects/fork_service_spec.rb
+5
-12
spec/workers/repository_fork_worker_spec.rb
spec/workers/repository_fork_worker_spec.rb
+0
-1
No files found.
features/steps/dashboard/new_project.rb
View file @
d0ec2882
...
@@ -44,7 +44,6 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps
...
@@ -44,7 +44,6 @@ class Spinach::Features::NewProject < Spinach::FeatureSteps
git_import_instructions
=
first
(
'.js-toggle-content'
)
git_import_instructions
=
first
(
'.js-toggle-content'
)
expect
(
git_import_instructions
).
to
be_visible
expect
(
git_import_instructions
).
to
be_visible
expect
(
git_import_instructions
).
to
have_content
"Git repository URL"
expect
(
git_import_instructions
).
to
have_content
"Git repository URL"
expect
(
git_import_instructions
).
to
have_content
"The repository must be accessible over HTTP(S). If it is not publicly accessible, you can add authentication information to the URL:"
end
end
step
'I click on "Google Code"'
do
step
'I click on "Google Code"'
do
...
...
spec/services/projects/fork_service_spec.rb
View file @
d0ec2882
...
@@ -25,13 +25,6 @@ describe Projects::ForkService do
...
@@ -25,13 +25,6 @@ describe Projects::ForkService do
end
end
end
end
context
'fork project failure'
do
it
"fails due to transaction failure"
do
@to_project
=
fork_project
(
@from_project
,
@to_user
,
false
)
expect
(
@to_project
.
import_failed?
)
end
end
context
'project already exists'
do
context
'project already exists'
do
it
"should fail due to validation, not transaction failure"
do
it
"should fail due to validation, not transaction failure"
do
@existing_project
=
create
(
:project
,
creator_id:
@to_user
.
id
,
name:
@from_project
.
name
,
namespace:
@to_namespace
)
@existing_project
=
create
(
:project
,
creator_id:
@to_user
.
id
,
name:
@from_project
.
name
,
namespace:
@to_namespace
)
...
@@ -66,7 +59,7 @@ describe Projects::ForkService do
...
@@ -66,7 +59,7 @@ describe Projects::ForkService do
context
'fork project for group'
do
context
'fork project for group'
do
it
'group owner successfully forks project into the group'
do
it
'group owner successfully forks project into the group'
do
to_project
=
fork_project
(
@project
,
@group_owner
,
true
,
@opts
)
to_project
=
fork_project
(
@project
,
@group_owner
,
@opts
)
expect
(
to_project
.
owner
).
to
eq
(
@group
)
expect
(
to_project
.
owner
).
to
eq
(
@group
)
expect
(
to_project
.
namespace
).
to
eq
(
@group
)
expect
(
to_project
.
namespace
).
to
eq
(
@group
)
expect
(
to_project
.
name
).
to
eq
(
@project
.
name
)
expect
(
to_project
.
name
).
to
eq
(
@project
.
name
)
...
@@ -78,7 +71,7 @@ describe Projects::ForkService do
...
@@ -78,7 +71,7 @@ describe Projects::ForkService do
context
'fork project for group when user not owner'
do
context
'fork project for group when user not owner'
do
it
'group developer should fail to fork project into the group'
do
it
'group developer should fail to fork project into the group'
do
to_project
=
fork_project
(
@project
,
@developer
,
true
,
@opts
)
to_project
=
fork_project
(
@project
,
@developer
,
@opts
)
expect
(
to_project
.
errors
[
:namespace
]).
to
eq
([
'is not valid'
])
expect
(
to_project
.
errors
[
:namespace
]).
to
eq
([
'is not valid'
])
end
end
end
end
...
@@ -87,7 +80,7 @@ describe Projects::ForkService do
...
@@ -87,7 +80,7 @@ describe Projects::ForkService do
it
'should fail due to validation, not transaction failure'
do
it
'should fail due to validation, not transaction failure'
do
existing_project
=
create
(
:project
,
name:
@project
.
name
,
existing_project
=
create
(
:project
,
name:
@project
.
name
,
namespace:
@group
)
namespace:
@group
)
to_project
=
fork_project
(
@project
,
@group_owner
,
true
,
@opts
)
to_project
=
fork_project
(
@project
,
@group_owner
,
@opts
)
expect
(
existing_project
.
persisted?
).
to
be_truthy
expect
(
existing_project
.
persisted?
).
to
be_truthy
expect
(
to_project
.
errors
[
:name
]).
to
eq
([
'has already been taken'
])
expect
(
to_project
.
errors
[
:name
]).
to
eq
([
'has already been taken'
])
expect
(
to_project
.
errors
[
:path
]).
to
eq
([
'has already been taken'
])
expect
(
to_project
.
errors
[
:path
]).
to
eq
([
'has already been taken'
])
...
@@ -95,8 +88,8 @@ describe Projects::ForkService do
...
@@ -95,8 +88,8 @@ describe Projects::ForkService do
end
end
end
end
def
fork_project
(
from_project
,
user
,
fork_success
=
true
,
params
=
{})
def
fork_project
(
from_project
,
user
,
params
=
{})
allow
(
RepositoryForkWorker
).
to
receive
(
:perform_async
).
and_return
(
fork_success
)
allow
(
RepositoryForkWorker
).
to
receive
(
:perform_async
).
and_return
(
true
)
Projects
::
ForkService
.
new
(
from_project
,
user
,
params
).
execute
Projects
::
ForkService
.
new
(
from_project
,
user
,
params
).
execute
end
end
end
end
spec/workers/repository_fork_worker_spec.rb
View file @
d0ec2882
...
@@ -12,7 +12,6 @@ describe RepositoryForkWorker do
...
@@ -12,7 +12,6 @@ describe RepositoryForkWorker do
project
.
path_with_namespace
,
project
.
path_with_namespace
,
fork_project
.
namespace
.
path
).
fork_project
.
namespace
.
path
).
and_return
(
true
)
and_return
(
true
)
expect
(
ProjectCacheWorker
).
to
receive
(
:perform_async
)
subject
.
perform
(
project
.
id
,
subject
.
perform
(
project
.
id
,
project
.
path_with_namespace
,
project
.
path_with_namespace
,
...
...
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