Commit d6474f22 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Preserve created at time of notes when moving issue

parent 797af064
......@@ -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
......
......@@ -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
......
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