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
b22ae0c0
Commit
b22ae0c0
authored
Sep 14, 2017
by
Alexis Reigel
Committed by
Alexis Reigel
Jan 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
invoke SystemHooksService instead of direct model
parent
9f7811e4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
4 additions
and
10 deletions
+4
-10
project.rb
app/models/project.rb
+1
-3
project_spec.rb
spec/models/project_spec.rb
+3
-7
No files found.
app/models/project.rb
View file @
b22ae0c0
...
...
@@ -975,9 +975,7 @@ class Project < ActiveRecord::Base
end
end
SystemHook
.
public_send
(
hooks_scope
).
each
do
|
hook
|
# rubocop:disable GitlabSecurity/PublicSend
hook
.
async_execute
(
data
,
hooks_scope
.
to_s
)
end
SystemHooksService
.
new
.
execute_hooks
(
data
,
hooks_scope
)
end
def
execute_services
(
data
,
hooks_scope
=
:push_hooks
)
...
...
spec/models/project_spec.rb
View file @
b22ae0c0
...
...
@@ -3190,14 +3190,10 @@ describe Project do
end
it
'executes the system hooks with the specified scope'
do
create
:system_hook
,
merge_requests_events:
true
,
tag_push_events:
false
create
:system_hook
,
merge_requests_events:
false
,
tag_push_events:
true
allow_any_instance_of
(
SystemHook
).
to
receive
(
:async_execute
).
once
project
=
create
:project
expect_any_instance_of
(
SystemHooksService
).
to
receive
(
:execute_hooks
).
with
({
data:
'data'
},
:merge_request_hooks
)
expect_any_instance_of
(
SystemHook
).
to
receive
(
:async_execute
).
once
project
.
execute_hooks
({},
:tag_push_hooks
)
project
=
build
(
:project
)
project
.
execute_hooks
({
data:
'data'
},
:merge_request_hooks
)
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