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
77540619
Commit
77540619
authored
Aug 03, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Test against the status in the payload
parent
9e06bde2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+9
-1
No files found.
spec/models/ci/pipeline_spec.rb
View file @
77540619
...
@@ -567,6 +567,12 @@ describe Ci::Pipeline, models: true do
...
@@ -567,6 +567,12 @@ describe Ci::Pipeline, models: true do
create
(
:ci_build
,
:pending
,
pipeline:
pipeline
,
name:
name
)
create
(
:ci_build
,
:pending
,
pipeline:
pipeline
,
name:
name
)
end
end
def
requested
status
have_requested
(
:post
,
hook
.
url
).
with
do
|
req
|
JSON
.
parse
(
req
.
body
)[
'object_attributes'
][
'status'
]
==
status
end
.
once
end
let
(
:build_a
)
{
create_build
(
'a'
)
}
let
(
:build_a
)
{
create_build
(
'a'
)
}
let
(
:build_b
)
{
create_build
(
'b'
)
}
let
(
:build_b
)
{
create_build
(
'b'
)
}
...
@@ -578,7 +584,9 @@ describe Ci::Pipeline, models: true do
...
@@ -578,7 +584,9 @@ describe Ci::Pipeline, models: true do
end
end
it
'fires 3 hooks'
do
it
'fires 3 hooks'
do
expect
(
WebMock
).
to
have_requested
(
:post
,
hook
.
url
).
times
(
3
)
%w(pending running success)
.
each
do
|
status
|
expect
(
WebMock
).
to
requested
(
status
)
end
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