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
Léo-Paul Géneau
gitlab-ce
Commits
209c72c4
Commit
209c72c4
authored
Sep 15, 2015
by
Kamil Trzcinski
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix: services/ci/create_project_service_spec.rb
parent
345ff6cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
14 deletions
+12
-14
spec/services/ci/create_project_service_spec.rb
spec/services/ci/create_project_service_spec.rb
+12
-14
No files found.
spec/services/ci/create_project_service_spec.rb
View file @
209c72c4
...
@@ -3,14 +3,14 @@ require 'spec_helper'
...
@@ -3,14 +3,14 @@ require 'spec_helper'
describe
Ci
::
CreateProjectService
do
describe
Ci
::
CreateProjectService
do
let
(
:service
)
{
Ci
::
CreateProjectService
.
new
}
let
(
:service
)
{
Ci
::
CreateProjectService
.
new
}
let
(
:current_user
)
{
double
.
as_null_object
}
let
(
:current_user
)
{
double
.
as_null_object
}
let
(
:project
_dump
)
{
YAML
.
load
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/raw_project.yml'
))
}
let
(
:project
)
{
FactoryGirl
.
create
:project
}
describe
:execute
do
describe
:execute
do
context
'valid params'
do
context
'valid params'
do
let
(
:project
)
{
service
.
execute
(
current_user
,
project_dump
,
'http://localhost/projects/:project_id'
)
}
subject
{
service
.
execute
(
current_user
,
project
,
'http://localhost/projects/:project_id'
)
}
it
{
expect
(
project
).
to
be_kind_of
(
Project
)
}
it
{
is_expected
.
to
be_kind_of
(
Ci
::
Project
)
}
it
{
expect
(
project
)
.
to
be_persisted
}
it
{
is_expected
.
to
be_persisted
}
end
end
context
'without project dump'
do
context
'without project dump'
do
...
@@ -20,18 +20,16 @@ describe Ci::CreateProjectService do
...
@@ -20,18 +20,16 @@ describe Ci::CreateProjectService do
end
end
context
"forking"
do
context
"forking"
do
it
"uses project as a template for settings and jobs"
do
let
(
:ci_origin_project
)
{
origin_project
=
FactoryGirl
.
create
(
:ci_project
)
FactoryGirl
.
create
(
:ci_project
,
shared_runners_enabled:
true
,
public:
true
,
allow_git_fetch:
true
)
origin_project
.
shared_runners_enabled
=
true
}
origin_project
.
public
=
true
origin_project
.
allow_git_fetch
=
true
origin_project
.
save!
project
=
service
.
execute
(
current_user
,
project_dump
,
'http://localhost/projects/:project_id'
,
origin_project
)
subject
{
service
.
execute
(
current_user
,
project
,
'http://localhost/projects/:project_id'
,
ci_origin_project
)
}
expect
(
project
.
shared_runners_enabled
).
to
be_truthy
it
"uses project as a template for settings and jobs"
do
expect
(
project
.
public
).
to
be_truthy
expect
(
subject
.
shared_runners_enabled
).
to
be_truthy
expect
(
project
.
allow_git_fetch
).
to
be_truthy
expect
(
subject
.
public
).
to
be_truthy
expect
(
subject
.
allow_git_fetch
).
to
be_truthy
end
end
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