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
b9626ae8
Commit
b9626ae8
authored
Oct 22, 2019
by
allison.browne
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up zoom specs
parent
97330c56
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
13 additions
and
21 deletions
+13
-21
app/models/zoom_meeting.rb
app/models/zoom_meeting.rb
+2
-2
app/services/issues/zoom_link_service.rb
app/services/issues/zoom_link_service.rb
+1
-5
spec/helpers/issuables_helper_spec.rb
spec/helpers/issuables_helper_spec.rb
+0
-1
spec/services/issues/update_service_spec.rb
spec/services/issues/update_service_spec.rb
+1
-1
spec/services/issues/zoom_link_service_spec.rb
spec/services/issues/zoom_link_service_spec.rb
+5
-6
spec/support/shared_examples/quick_actions/issue/zoom_quick_actions_shared_examples.rb
...quick_actions/issue/zoom_quick_actions_shared_examples.rb
+4
-6
No files found.
app/models/zoom_meeting.rb
View file @
b9626ae8
...
...
@@ -14,10 +14,10 @@ class ZoomMeeting < ApplicationRecord
scope
:added_to_issue
,
->
{
where
(
issue_status: :added
)
}
scope
:removed_from_issue
,
->
{
where
(
issue_status: :removed
)
}
scope
:canonical
_meetings
,
->
(
issue
)
{
where
(
issue:
issue
)
&
.
added_to_issue
}
scope
:canonical
,
->
(
issue
)
{
where
(
issue:
issue
)
&
.
added_to_issue
}
def
self
.
canonical_meeting
(
issue
)
canonical
_meetings
(
issue
)
&
.
first
canonical
(
issue
)
&
.
first
end
def
self
.
canonical_meeting_url
(
issue
)
...
...
app/services/issues/zoom_link_service.rb
View file @
b9626ae8
...
...
@@ -6,7 +6,7 @@ module Issues
super
(
issue
.
project
,
user
)
@issue
=
issue
@added_meeting
=
fetch_added_meeting
@added_meeting
=
ZoomMeeting
.
canonical_meeting
(
@issue
)
end
def
add_link
(
link
)
...
...
@@ -41,10 +41,6 @@ module Issues
attr_reader
:issue
def
fetch_added_meeting
ZoomMeeting
.
canonical_meeting
(
@issue
)
end
def
track_meeting_added_event
::
Gitlab
::
Tracking
.
event
(
'IncidentManagement::ZoomIntegration'
,
'add_zoom_meeting'
,
label:
'Issue ID'
,
value:
issue
.
id
)
end
...
...
spec/helpers/issuables_helper_spec.rb
View file @
b9626ae8
...
...
@@ -252,7 +252,6 @@ describe IssuablesHelper do
it_behaves_like
'sets zoomMeetingUrl to canonical meeting url'
end
end
end
end
...
...
spec/services/issues/update_service_spec.rb
View file @
b9626ae8
...
...
@@ -226,7 +226,7 @@ describe Issues::UpdateService, :mailer do
end
end
context
'when zoom
meetings is changed'
do
context
'when zoom
_
meetings is changed'
do
it
'creates zoom_link_added system note when a zoom link is added'
do
update_issue
(
zoom_meetings:
[
create
(
:zoom_meeting
,
issue:
issue
)])
note
=
find_note
(
'added a Zoom call'
)
...
...
spec/services/issues/zoom_link_service_spec.rb
View file @
b9626ae8
...
...
@@ -35,7 +35,7 @@ describe Issues::ZoomLinkService do
describe
'#add_link'
do
shared_examples
'can add meeting'
do
it
'appends the
link
zoom_meetings'
do
it
'appends the
new meeting to
zoom_meetings'
do
expect
(
result
).
to
be_success
expect
(
result
.
payload
[
:zoom_meetings
].
map
(
&
:url
))
.
to
include
(
zoom_link
)
...
...
@@ -60,7 +60,7 @@ describe Issues::ZoomLinkService do
context
'without existing Zoom meeting'
do
include_examples
'can add meeting'
context
'with invalid Zoom
meeting
'
do
context
'with invalid Zoom
url
'
do
let
(
:zoom_link
)
{
'https://not-zoom.link'
}
include_examples
'cannot add meeting'
...
...
@@ -81,8 +81,7 @@ describe Issues::ZoomLinkService do
describe
'#can_add_link?'
do
subject
{
service
.
can_add_link?
}
context
'without Zoom link'
do
context
'without "added" zoom meeting'
do
it
{
is_expected
.
to
eq
(
true
)
}
context
'with insufficient permissions'
do
...
...
@@ -110,10 +109,10 @@ describe Issues::ZoomLinkService do
shared_examples
'can remove meeting'
do
it
'can remove the meeting'
do
expect
(
result
).
to
be_success
expect
(
result
.
payload
[
:zoom_meetings
].
filter
{
|
z
|
z
.
issue_status
==
1
})
expect
(
result
.
payload
[
:zoom_meetings
].
filter
{
|
z
|
z
.
issue_status
==
"added"
})
.
to
be_empty
end
it
'tracks the remove event'
do
expect
(
Gitlab
::
Tracking
).
to
receive
(
:event
)
.
with
(
'IncidentManagement::ZoomIntegration'
,
'remove_zoom_meeting'
,
label:
'Issue ID'
,
value:
issue
.
id
)
...
...
spec/support/shared_examples/quick_actions/issue/zoom_quick_actions_shared_examples.rb
View file @
b9626ae8
...
...
@@ -14,24 +14,22 @@ shared_examples 'zoom quick actions' do
expect
(
page
).
not_to
have_content
(
'Zoom meeting added'
)
expect
(
page
).
not_to
have_content
(
'Failed to add a Zoom meeting'
)
expect
(
issue
.
reload
.
zoom_meetings
[
0
].
url
).
not_to
eq
(
zoom_link
)
expect
(
ZoomMeeting
.
canonical_meeting_url
(
issue
.
reload
)
).
not_to
eq
(
zoom_link
)
end
end
shared_examples
'success'
do
it
'adds a Zoom link'
do
add_note
(
"/zoom
#{
zoom_link
}
"
)
wait_for_requests
expect
(
page
).
to
have_content
(
'Zoom meeting added'
)
expect
(
issue
.
reload
.
zoom_meetings
[
0
].
url
).
to
eq
(
zoom_link
)
expect
(
ZoomMeeting
.
canonical_meeting_url
(
issue
.
reload
)
).
to
eq
(
zoom_link
)
end
end
context
'without zoom_meetings'
do
include_examples
'success'
it
'cannot add invalid zoom link'
do
...
...
@@ -70,7 +68,7 @@ shared_examples 'zoom quick actions' do
expect
(
page
).
not_to
have_content
(
'Zoom meeting removed'
)
expect
(
page
).
not_to
have_content
(
'Failed to remove a Zoom meeting'
)
expect
(
issue
.
reload
.
zoom_meetings
.
filter
{
|
z
|
z
.
issue_status
==
ZoomMeeting
.
issue_statuses
[
:added
]
}).
to
be_empty
expect
(
ZoomMeeting
.
canonical_meeting_url
(
issue
.
reload
)).
to
be_nil
end
end
...
...
@@ -83,7 +81,7 @@ shared_examples 'zoom quick actions' do
wait_for_requests
expect
(
page
).
to
have_content
(
'Zoom meeting removed'
)
expect
(
issue
.
reload
.
zoom_meetings
.
filter
{
|
z
|
z
.
issue_status
==
ZoomMeeting
.
issue_statuses
[
:added
]
}).
to
be_empty
expect
(
ZoomMeeting
.
canonical_meeting_url
(
issue
.
reload
)).
to
be_nil
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