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
f9075eb0
Commit
f9075eb0
authored
Aug 01, 2016
by
Lin Jen-Shin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test for running hooks for pipeline after touched
parent
016d4f6b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
2 deletions
+31
-2
pipeline_spec.rb
spec/models/ci/pipeline_spec.rb
+31
-2
No files found.
spec/models/ci/pipeline_spec.rb
View file @
f9075eb0
...
@@ -513,7 +513,7 @@ describe Ci::Pipeline, models: true do
...
@@ -513,7 +513,7 @@ describe Ci::Pipeline, models: true do
create
:ci_build
,
:success
,
pipeline:
pipeline
,
name:
'rspec'
create
:ci_build
,
:success
,
pipeline:
pipeline
,
name:
'rspec'
create
:ci_build
,
:allowed_to_fail
,
:failed
,
pipeline:
pipeline
,
name:
'rubocop'
create
:ci_build
,
:allowed_to_fail
,
:failed
,
pipeline:
pipeline
,
name:
'rubocop'
end
end
it
'returns true'
do
it
'returns true'
do
is_expected
.
to
be_truthy
is_expected
.
to
be_truthy
end
end
...
@@ -524,7 +524,7 @@ describe Ci::Pipeline, models: true do
...
@@ -524,7 +524,7 @@ describe Ci::Pipeline, models: true do
create
:ci_build
,
:success
,
pipeline:
pipeline
,
name:
'rspec'
create
:ci_build
,
:success
,
pipeline:
pipeline
,
name:
'rspec'
create
:ci_build
,
:allowed_to_fail
,
:success
,
pipeline:
pipeline
,
name:
'rubocop'
create
:ci_build
,
:allowed_to_fail
,
:success
,
pipeline:
pipeline
,
name:
'rubocop'
end
end
it
'returns false'
do
it
'returns false'
do
is_expected
.
to
be_falsey
is_expected
.
to
be_falsey
end
end
...
@@ -542,4 +542,33 @@ describe Ci::Pipeline, models: true do
...
@@ -542,4 +542,33 @@ describe Ci::Pipeline, models: true do
end
end
end
end
end
end
describe
'#execute_hooks'
do
let!
(
:hook
)
do
create
(
:project_hook
,
project:
project
,
pipeline_events:
enabled
)
end
let
(
:enabled
)
{
raise
NotImplementedError
}
before
do
WebMock
.
stub_request
(
:post
,
hook
.
url
)
pipeline
.
touch
ProjectWebHookWorker
.
drain
end
context
'with pipeline hooks enabled'
do
let
(
:enabled
)
{
true
}
it
'executes pipeline_hook after touched'
do
expect
(
WebMock
).
to
have_requested
(
:post
,
hook
.
url
).
once
end
end
context
'with pipeline hooks disabled'
do
let
(
:enabled
)
{
false
}
it
'did not execute pipeline_hook after touched'
do
expect
(
WebMock
).
not_to
have_requested
(
:post
,
hook
.
url
)
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