Preserve created at time of notes when moving issue

This commit is contained in:
Grzegorz Bizon 2016-03-20 17:05:21 +01:00
parent 797af06491
commit d6474f22d2
2 changed files with 7 additions and 1 deletions

View file

@ -53,7 +53,8 @@ module Issues
@old_issue.notes.find_each do |note|
new_note = note.dup
new_params = { project: @new_project, noteable: @new_issue,
note: unfold_references(new_note.note) }
note: unfold_references(new_note.note),
created_at: note.created_at }
new_note.update(new_params)
end

View file

@ -121,6 +121,11 @@ describe Issues::MoveService, services: true do
it 'preserves orignal author of comment' do
expect(user_notes.pluck(:author_id)).to all(eq(author.id))
end
it 'preserves time when note has been created at' do
expect(old_issue.notes.first.created_at)
.to eq new_issue.notes.first.created_at
end
end
context 'notes with references' do