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
22b80a11
Commit
22b80a11
authored
Oct 10, 2019
by
Patrick Derichs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Extract Zoom System Note Service
Also moving specs.
parent
1987c8a7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
61 additions
and
16 deletions
+61
-16
app/services/system_note_service.rb
app/services/system_note_service.rb
+2
-2
app/services/system_notes/zoom_service.rb
app/services/system_notes/zoom_service.rb
+13
-0
spec/services/system_note_service_spec.rb
spec/services/system_note_service_spec.rb
+10
-14
spec/services/system_notes/zoom_service_spec.rb
spec/services/system_notes/zoom_service_spec.rb
+36
-0
No files found.
app/services/system_note_service.rb
View file @
22b80a11
...
@@ -317,11 +317,11 @@ module SystemNoteService
...
@@ -317,11 +317,11 @@ module SystemNoteService
end
end
def
zoom_link_added
(
issue
,
project
,
author
)
def
zoom_link_added
(
issue
,
project
,
author
)
create_note
(
NoteSummary
.
new
(
issue
,
project
,
author
,
_
(
'added a Zoom call to this issue'
),
action:
'pinned_embed'
))
::
SystemNotes
::
ZoomService
.
new
(
noteable:
issue
,
project:
project
,
author:
author
).
zoom_link_added
end
end
def
zoom_link_removed
(
issue
,
project
,
author
)
def
zoom_link_removed
(
issue
,
project
,
author
)
create_note
(
NoteSummary
.
new
(
issue
,
project
,
author
,
_
(
'removed a Zoom call from this issue'
),
action:
'pinned_embed'
))
::
SystemNotes
::
ZoomService
.
new
(
noteable:
issue
,
project:
project
,
author:
author
).
zoom_link_removed
end
end
private
private
...
...
app/services/system_notes/zoom_service.rb
0 → 100644
View file @
22b80a11
# frozen_string_literal: true
module
SystemNotes
class
ZoomService
<
::
SystemNotes
::
BaseService
def
zoom_link_added
create_note
(
NoteSummary
.
new
(
noteable
,
project
,
author
,
_
(
'added a Zoom call to this issue'
),
action:
'pinned_embed'
))
end
def
zoom_link_removed
create_note
(
NoteSummary
.
new
(
noteable
,
project
,
author
,
_
(
'removed a Zoom call from this issue'
),
action:
'pinned_embed'
))
end
end
end
spec/services/system_note_service_spec.rb
View file @
22b80a11
...
@@ -271,26 +271,22 @@ describe SystemNoteService do
...
@@ -271,26 +271,22 @@ describe SystemNoteService do
end
end
describe
'.zoom_link_added'
do
describe
'.zoom_link_added'
do
subject
{
described_class
.
zoom_link_added
(
issue
,
project
,
author
)
}
it
'calls ZoomService'
do
expect_next_instance_of
(
::
SystemNotes
::
ZoomService
)
do
|
service
|
it_behaves_like
'a system note'
do
expect
(
service
).
to
receive
(
:zoom_link_added
)
let
(
:action
)
{
'pinned_embed'
}
end
end
it
'sets the zoom link added note text'
do
described_class
.
zoom_link_added
(
noteable
,
project
,
author
)
expect
(
subject
.
note
).
to
eq
(
'added a Zoom call to this issue'
)
end
end
end
end
describe
'.zoom_link_removed'
do
describe
'.zoom_link_removed'
do
subject
{
described_class
.
zoom_link_removed
(
issue
,
project
,
author
)
}
it
'calls ZoomService'
do
expect_next_instance_of
(
::
SystemNotes
::
ZoomService
)
do
|
service
|
it_behaves_like
'a system note'
do
expect
(
service
).
to
receive
(
:zoom_link_removed
)
let
(
:action
)
{
'pinned_embed'
}
end
end
it
'sets the zoom link removed note text'
do
described_class
.
zoom_link_removed
(
noteable
,
project
,
author
)
expect
(
subject
.
note
).
to
eq
(
'removed a Zoom call from this issue'
)
end
end
end
end
...
...
spec/services/system_notes/zoom_service_spec.rb
0 → 100644
View file @
22b80a11
# frozen_string_literal: true
require
'spec_helper'
describe
::
SystemNotes
::
ZoomService
do
let_it_be
(
:project
)
{
create
(
:project
,
:repository
)
}
let_it_be
(
:author
)
{
create
(
:user
)
}
let
(
:noteable
)
{
create
(
:issue
,
project:
project
)
}
let
(
:service
)
{
described_class
.
new
(
noteable:
noteable
,
project:
project
,
author:
author
)
}
describe
'#zoom_link_added'
do
subject
{
service
.
zoom_link_added
}
it_behaves_like
'a system note'
do
let
(
:action
)
{
'pinned_embed'
}
end
it
'sets the zoom link added note text'
do
expect
(
subject
.
note
).
to
eq
(
'added a Zoom call to this issue'
)
end
end
describe
'#zoom_link_removed'
do
subject
{
service
.
zoom_link_removed
}
it_behaves_like
'a system note'
do
let
(
:action
)
{
'pinned_embed'
}
end
it
'sets the zoom link removed note text'
do
expect
(
subject
.
note
).
to
eq
(
'removed a Zoom call from this issue'
)
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