Skip to content
Snippets Groups Projects
Unverified Commit c87c7ce0 authored by Heinrich Lee Yu's avatar Heinrich Lee Yu
Browse files

Fix system note timestamp for moved issue

The "moved from" system note should not use the issue creation timestamp
because that is copied from the original issue

Changelog: fixed
parent bb528371
No related merge requests found
......@@ -16,6 +16,7 @@ def execute(original_entity, target_project = nil)
#
ApplicationRecord.transaction do
@new_entity = create_new_entity
@new_entity.system_note_timestamp = nil
update_new_entity
update_old_entity
......
......@@ -16,7 +16,7 @@
let_it_be(:new_project) { create(:project, namespace: sub_group_2) }
let(:old_issue) do
create(:issue, title: title, description: description, project: old_project, author: author)
create(:issue, title: title, description: description, project: old_project, author: author, created_at: 1.day.ago, updated_at: 1.day.ago)
end
subject(:move_service) do
......@@ -62,8 +62,11 @@
expect(old_issue.notes.last.note).to start_with 'moved to'
end
it 'adds system note to new issue at the end' do
expect(new_issue.notes.last.note).to start_with 'moved from'
it 'adds system note to new issue at the end', :freeze_time do
system_note = new_issue.notes.last
expect(system_note.note).to start_with 'moved from'
expect(system_note.created_at).to be_like_time(Time.current)
end
it 'closes old issue' do
......
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