diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-02 15:09:03 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-10-02 15:09:03 +0300 |
commit | 6092dcc437ef3e9300cc32cb7c6daea9448cba40 (patch) | |
tree | 7a93e011871915b658537ef4787b87633ada5178 /spec/services/design_management | |
parent | 251d3d2b234a4b449edefec4ed8dcf9bc2f8be37 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/design_management')
-rw-r--r-- | spec/services/design_management/copy_design_collection/copy_service_spec.rb | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/spec/services/design_management/copy_design_collection/copy_service_spec.rb b/spec/services/design_management/copy_design_collection/copy_service_spec.rb index 09a4df59c6a..e93e5f13fea 100644 --- a/spec/services/design_management/copy_design_collection/copy_service_spec.rb +++ b/spec/services/design_management/copy_design_collection/copy_service_spec.rb @@ -133,18 +133,26 @@ RSpec.describe DesignManagement::CopyDesignCollection::CopyService, :clean_gitla end it 'copies design notes correctly', :aggregate_failures, :sidekiq_inline do - note = create(:diff_note_on_design, noteable: designs.first, project: project) + old_notes = [ + create(:diff_note_on_design, note: 'first note', noteable: designs.first, project: project, author: create(:user)), + create(:diff_note_on_design, note: 'second note', noteable: designs.first, project: project, author: create(:user)) + ] + matchers = old_notes.map do |note| + have_attributes( + note.attributes.slice( + :type, + :author_id, + :note, + :position + ) + ) + end - expect { subject }.to change { Note.count }.by(1) + expect { subject }.to change { Note.count }.by(2) - new_note = target_issue.designs.first.notes.first + new_notes = target_issue.designs.first.notes.fresh - expect(new_note).to have_attributes( - type: note.type, - author_id: note.author_id, - note: note.note, - position: note.position - ) + expect(new_notes).to match_array(matchers) end it 'links the LfsObjects' do |