Commit 1a619abf authored by allison.browne's avatar allison.browne

Address code review feedback

parent c86cbc5f
......@@ -14,7 +14,7 @@ class ZoomMeeting < ApplicationRecord
scope :added_to_issue, -> { where(issue_status: :added) }
scope :removed_from_issue, -> { where(issue_status: :removed) }
scope :canonical, -> (issue) { where(issue: issue)&.added_to_issue }
scope :canonical, -> (issue) { where(issue: issue).added_to_issue }
def self.canonical_meeting(issue)
canonical(issue)&.first
......
......@@ -61,8 +61,7 @@ module Issues
end
def remove_zoom_meeting
@added_meeting.issue_status = :removed
@added_meeting.save
@added_meeting.update(issue_status: :removed)
track_meeting_removed_event
issue.zoom_meetings
end
......
......@@ -21,8 +21,7 @@ class ZoomNotesService
private
def zoom_link_added?
meetings = @issue.zoom_meetings.select { |z| z.issue_status == "added" }
!meetings.empty?
@issue.zoom_meetings.any? { |z| z.issue_status == "added" }
end
def zoom_link_added_notification
......
......@@ -187,7 +187,6 @@ describe Issues::UpdateService, :mailer do
it 'creates system note about issue reassign' do
note = find_note('assigned to')
expect(note).not_to be_nil
expect(note.note).to include "assigned to #{user2.to_reference}"
end
......@@ -202,14 +201,12 @@ describe Issues::UpdateService, :mailer do
it 'creates system note about title change' do
note = find_note('changed title')
expect(note).not_to be_nil
expect(note.note).to eq 'changed title from **{-Old-} title** to **{+New+} title**'
end
it 'creates system note about discussion lock' do
note = find_note('locked this issue')
expect(note).not_to be_nil
expect(note.note).to eq 'locked this issue'
end
end
......@@ -221,7 +218,6 @@ describe Issues::UpdateService, :mailer do
note = find_note('changed the description')
expect(note).not_to be_nil
expect(note.note).to eq('changed the description')
end
end
......@@ -231,7 +227,6 @@ describe Issues::UpdateService, :mailer do
update_issue(zoom_meetings: [create(:zoom_meeting, issue: issue)])
note = find_note('added a Zoom call')
expect(note).not_to be_nil
expect(note.note).to eq('added a Zoom call to this issue')
end
end
......@@ -253,7 +248,6 @@ describe Issues::UpdateService, :mailer do
note = find_note('made the issue confidential')
expect(note).not_to be_nil
expect(note.note).to eq 'made the issue confidential'
end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment