diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-07 15:10:27 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-05-07 15:10:27 +0300 |
commit | 53f456b167f19877d663ee6ed510673cebee0f91 (patch) | |
tree | fcc0bb52b79c195bf0eda100cc5d7e7a16dc0c0b /spec/services/notes | |
parent | e8a31d8dc2afd673ca50d74d26edab0a0fec83ca (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/services/notes')
-rw-r--r-- | spec/services/notes/quick_actions_service_spec.rb | 24 |
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 |