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
3761a0c5
Commit
3761a0c5
authored
Nov 27, 2016
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extend pipelines factory with transient config attribute
parent
86e7f22b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
14 deletions
+9
-14
spec/factories/ci/pipelines.rb
spec/factories/ci/pipelines.rb
+8
-13
spec/services/ci/process_pipeline_service_spec.rb
spec/services/ci/process_pipeline_service_spec.rb
+1
-1
No files found.
spec/factories/ci/pipelines.rb
View file @
3761a0c5
...
@@ -21,21 +21,16 @@ FactoryGirl.define do
...
@@ -21,21 +21,16 @@ FactoryGirl.define do
end
end
factory
:ci_pipeline
do
factory
:ci_pipeline
do
after
(
:build
)
do
|
pipeline
|
transient
{
config
nil
}
allow
(
pipeline
).
to
receive
(
:ci_yaml_file
)
do
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci.yml'
))
end
end
end
factory
(
:ci_pipeline_with_yaml
)
do
transient
{
yaml
nil
}
after
(
:build
)
do
|
pipeline
,
evaluator
|
after
(
:build
)
do
|
pipeline
,
evaluator
|
raise
ArgumentError
unless
evaluator
.
yaml
allow
(
pipeline
).
to
receive
(
:ci_yaml_file
)
do
if
evaluator
.
config
allow
(
pipeline
).
to
receive
(
:ci_yaml_file
)
YAML
.
dump
(
evaluator
.
config
)
.
and_return
(
YAML
.
dump
(
evaluator
.
yaml
))
else
File
.
read
(
Rails
.
root
.
join
(
'spec/support/gitlab_stubs/gitlab_ci.yml'
))
end
end
end
end
end
end
end
end
...
...
spec/services/ci/process_pipeline_service_spec.rb
View file @
3761a0c5
...
@@ -295,7 +295,7 @@ describe Ci::ProcessPipelineService, services: true do
...
@@ -295,7 +295,7 @@ describe Ci::ProcessPipelineService, services: true do
context
'when there are builds that are not created yet'
do
context
'when there are builds that are not created yet'
do
let
(
:pipeline
)
do
let
(
:pipeline
)
do
create
(
:ci_pipeline
_with_yaml
,
yaml
:
config
)
create
(
:ci_pipeline
,
config
:
config
)
end
end
let
(
:config
)
do
let
(
:config
)
do
...
...
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