From 163a43629c9018beb5f2a474ce63a0065445471b Mon Sep 17 00:00:00 2001 From: Peter Leitzen Date: Wed, 24 Jul 2019 08:19:15 +0000 Subject: Prefer `flat_map` over `map` + `flatten` in specs Although `flat_map` is equivalent to `map` + `flatten(1)` (note the level 1) we can apply this same refactoring to all cases. --- spec/services/issues/update_service_spec.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'spec/services/issues/update_service_spec.rb') diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index 468e7c286d5..68b79132096 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -179,7 +179,7 @@ describe Issues::UpdateService, :mailer do it 'sends email to user2 about assign of new issue and email to user3 about issue unassignment' do deliveries = ActionMailer::Base.deliveries email = deliveries.last - recipients = deliveries.last(2).map(&:to).flatten + recipients = deliveries.last(2).flat_map(&:to) expect(recipients).to include(user2.email, user3.email) expect(email.subject).to include(issue.title) end -- cgit v1.2.1 From 1ce5bcacdbf56682e05fa63875203bf4d10584bc Mon Sep 17 00:00:00 2001 From: Heinrich Lee Yu Date: Wed, 24 Jul 2019 17:20:54 +0800 Subject: Remove code related to object hierarchy in MySQL These are not required because MySQL is not supported anymore --- spec/services/issues/update_service_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spec/services/issues/update_service_spec.rb') diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index 68b79132096..3ae7c7b1c1d 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -116,7 +116,7 @@ describe Issues::UpdateService, :mailer do expect(issue.relative_position).to be_between(issue1.relative_position, issue2.relative_position) end - context 'when moving issue between issues from different projects', :nested_groups do + context 'when moving issue between issues from different projects' do let(:group) { create(:group) } let(:subgroup) { create(:group, parent: group) } @@ -703,7 +703,7 @@ describe Issues::UpdateService, :mailer do end end - context 'when moving an issue ', :nested_groups do + context 'when moving an issue ' do it 'raises an error for invalid move ids within a project' do opts = { move_between_ids: [9000, 9999] } -- cgit v1.2.1 From 6613a57772ee14b121b790ab8048523d1c0430ce Mon Sep 17 00:00:00 2001 From: Jacopo Date: Sat, 20 Jul 2019 11:06:19 +0200 Subject: Add system notes for when a zoom call was added/removed from an issue Add a zoom link added / removed system note when a zoom link is being added / removed to the issue description. --- spec/services/issues/update_service_spec.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'spec/services/issues/update_service_spec.rb') diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index 468e7c286d5..f72618943b2 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -226,6 +226,15 @@ describe Issues::UpdateService, :mailer do end end + it 'creates zoom_link_added system note when a zoom link is added to the description' do + update_issue(description: 'Changed description https://zoom.us/j/5873603787') + + note = find_note('a Zoom call was added') + + expect(note).not_to be_nil + expect(note.note).to eq('a Zoom call was added to this issue') + end + context 'when issue turns confidential' do let(:opts) do { -- cgit v1.2.1 From 8463b21982e82ccb8903c8470bd5986d9804c335 Mon Sep 17 00:00:00 2001 From: Jacopo Date: Fri, 2 Aug 2019 12:23:52 +0200 Subject: Improve system notes for Zoom links changes: @user a Zoom call was added to this issue into: @user added a Zoom call to this issue Same concept appleis for "removed" --- spec/services/issues/update_service_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spec/services/issues/update_service_spec.rb') diff --git a/spec/services/issues/update_service_spec.rb b/spec/services/issues/update_service_spec.rb index d9f35afee06..fd9a63b79cc 100644 --- a/spec/services/issues/update_service_spec.rb +++ b/spec/services/issues/update_service_spec.rb @@ -229,10 +229,10 @@ describe Issues::UpdateService, :mailer do it 'creates zoom_link_added system note when a zoom link is added to the description' do update_issue(description: 'Changed description https://zoom.us/j/5873603787') - note = find_note('a Zoom call was added') + note = find_note('added a Zoom call') expect(note).not_to be_nil - expect(note.note).to eq('a Zoom call was added to this issue') + expect(note.note).to eq('added a Zoom call to this issue') end context 'when issue turns confidential' do -- cgit v1.2.1