diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-08-18 11:17:02 +0300 |
commit | b39512ed755239198a9c294b6a45e65c05900235 (patch) | |
tree | d234a3efade1de67c46b9e5a38ce813627726aa7 /spec/services/issues/move_service_spec.rb | |
parent | d31474cf3b17ece37939d20082b07f6657cc79a9 (diff) |
Add latest changes from gitlab-org/gitlab@15-3-stable-eev15.3.0-rc42
Diffstat (limited to 'spec/services/issues/move_service_spec.rb')
-rw-r--r-- | spec/services/issues/move_service_spec.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/spec/services/issues/move_service_spec.rb b/spec/services/issues/move_service_spec.rb index 5a1bb2e8b74..863df810d01 100644 --- a/spec/services/issues/move_service_spec.rb +++ b/spec/services/issues/move_service_spec.rb @@ -16,7 +16,7 @@ RSpec.describe Issues::MoveService do 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 @@ RSpec.describe Issues::MoveService do 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 @@ -137,7 +140,8 @@ RSpec.describe Issues::MoveService do end before do - SystemNoteService.change_due_date(old_issue, old_project, author, old_issue.due_date) + old_issue.update!(due_date: Date.today) + SystemNoteService.change_start_date_or_due_date(old_issue, old_project, author, old_issue.previous_changes.slice('due_date')) end it 'does not create extra system notes' do |