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
d46084c3
Commit
d46084c3
authored
Mar 26, 2020
by
Peter Leitzen
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Publish status page on emoji destroy
parent
6fba4972
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
61 additions
and
0 deletions
+61
-0
app/services/award_emojis/destroy_service.rb
app/services/award_emojis/destroy_service.rb
+8
-0
ee/app/services/ee/award_emojis/destroy_service.rb
ee/app/services/ee/award_emojis/destroy_service.rb
+18
-0
ee/spec/services/award_emojis/destroy_service_spec.rb
ee/spec/services/award_emojis/destroy_service_spec.rb
+35
-0
No files found.
app/services/award_emojis/destroy_service.rb
View file @
d46084c3
...
@@ -14,8 +14,16 @@ module AwardEmojis
...
@@ -14,8 +14,16 @@ module AwardEmojis
end
end
award
=
awards
.
destroy_all
.
first
# rubocop: disable DestroyAll
award
=
awards
.
destroy_all
.
first
# rubocop: disable DestroyAll
after_destroy
(
award
)
success
(
award:
award
)
success
(
award:
award
)
end
end
private
def
after_destroy
(
award
)
end
end
end
end
end
AwardEmojis
::
DestroyService
.
prepend_if_ee
(
'EE::AwardEmojis::DestroyService'
)
ee/app/services/ee/award_emojis/destroy_service.rb
0 → 100644
View file @
d46084c3
# frozen_string_literal: true
module
EE
module
AwardEmojis
module
DestroyService
extend
::
Gitlab
::
Utils
::
Override
private
override
:after_destroy
def
after_destroy
(
award
)
super
StatusPage
.
trigger_publish
(
project
,
current_user
,
award
)
end
end
end
end
ee/spec/services/award_emojis/destroy_service_spec.rb
0 → 100644
View file @
d46084c3
# frozen_string_literal: true
require
'spec_helper'
describe
AwardEmojis
::
DestroyService
do
let_it_be
(
:user
)
{
create
(
:user
)
}
let_it_be
(
:project
)
{
create
(
:project
)
}
let_it_be
(
:awardable
)
{
create
(
:note_on_issue
,
project:
project
)
}
let
(
:name
)
{
'thumbsup'
}
subject
(
:service
)
{
described_class
.
new
(
awardable
,
name
,
user
)
}
describe
'#execute'
do
describe
'publish to status page'
do
let
(
:execute
)
{
service
.
execute
}
let
(
:issue_id
)
{
awardable
.
noteable_id
}
before
do
create
(
:award_emoji
,
user:
user
,
name:
name
,
awardable:
awardable
)
end
context
'with recognized emoji'
do
let
(
:name
)
{
StatusPage
::
AWARD_EMOJI
}
include_examples
'trigger status page publish'
end
context
'with unrecognized emoji'
do
let
(
:name
)
{
'x'
}
include_examples
'no trigger status page publish'
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