Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/services/issues/move_service_spec.rb')
-rw-r--r--spec/services/issues/move_service_spec.rb12
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