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:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-05-07 15:10:27 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-05-07 15:10:27 +0300
commit53f456b167f19877d663ee6ed510673cebee0f91 (patch)
treefcc0bb52b79c195bf0eda100cc5d7e7a16dc0c0b /spec/services/notes/quick_actions_service_spec.rb
parente8a31d8dc2afd673ca50d74d26edab0a0fec83ca (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/notes/quick_actions_service_spec.rb')
-rw-r--r--spec/services/notes/quick_actions_service_spec.rb24
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/services/notes/quick_actions_service_spec.rb b/spec/services/notes/quick_actions_service_spec.rb
index c098500b78a..bdce049bd3d 100644
--- a/spec/services/notes/quick_actions_service_spec.rb
+++ b/spec/services/notes/quick_actions_service_spec.rb
@@ -103,6 +103,30 @@ RSpec.describe Notes::QuickActionsService do
expect(Timelog.last.note_id).to eq(note.id)
end
end
+
+ context 'adds a system note' do
+ context 'when not specifying a date' do
+ let(:note_text) { "/spend 1h" }
+
+ it 'does not include the date' do
+ _, update_params = service.execute(note)
+ service.apply_updates(update_params, note)
+
+ expect(Note.last.note).to eq('added 1h of time spent')
+ end
+ end
+
+ context 'when specifying a date' do
+ let(:note_text) { "/spend 1h 2020-01-01" }
+
+ it 'does include the date' do
+ _, update_params = service.execute(note)
+ service.apply_updates(update_params, note)
+
+ expect(Note.last.note).to eq('added 1h of time spent at 2020-01-01')
+ end
+ end
+ end
end
end