BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
20fc42e9
Commit
20fc42e9
authored
Oct 10, 2017
by
Grzegorz Bizon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve post_receive spec by not stubbing private methods
parent
9ad48a74
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
5 deletions
+7
-5
post_receive_spec.rb
spec/workers/post_receive_spec.rb
+7
-5
No files found.
spec/workers/post_receive_spec.rb
View file @
20fc42e9
...
...
@@ -66,19 +66,21 @@ describe PostReceive do
end
context
"gitlab-ci.yml"
do
let
(
:changes
)
{
"123456 789012 refs/heads/feature
\n
654321 210987 refs/tags/tag"
}
subject
{
described_class
.
new
.
perform
(
gl_repository
,
key_id
,
base64_changes
)
}
context
"creates a Ci::Pipeline for every change"
do
before
do
stub_ci_pipeline_to_return_yaml_file
# TODO, don't stub private methods
#
allow_any_instance_of
(
Ci
::
CreatePipelineService
)
.
to
receive
(
:commit
).
and_return
(
OpenStruct
.
new
(
id:
'123456'
))
allow_any_instance_of
(
Project
)
.
to
receive
(
:commit
)
.
and_return
(
project
.
commit
)
allow_any_instance_of
(
Repository
)
.
to
receive
(
:branch_exists?
).
and_return
(
true
)
.
to
receive
(
:branch_exists?
)
.
and_return
(
true
)
end
it
{
expect
{
subject
}.
to
change
{
Ci
::
Pipeline
.
count
}.
by
(
2
)
}
...
...
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