diff options
author | Stan Hu <stanhu@gmail.com> | 2018-09-10 00:19:05 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-09-10 00:19:05 +0300 |
commit | 30227f8e8c277f755ac691d7705e503848f76395 (patch) | |
tree | bae4080362ef99c1cc455d1c9af2dfe2d3a21639 /spec/services/system_note_service_spec.rb | |
parent | 3fe14f935ca7b68585c6df5458d2070bbff051f7 (diff) | |
parent | 997dda50f4567cf218df80c0fd5fe64afb18bf2e (diff) |
Merge branch '38208-due-dates-system-notes' into 'master'
Add system note when due date is changed
Closes #38208
See merge request gitlab-org/gitlab-ce!21628
Diffstat (limited to 'spec/services/system_note_service_spec.rb')
-rw-r--r-- | spec/services/system_note_service_spec.rb | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb index d5d750e182b..f4b7cb8c90a 100644 --- a/spec/services/system_note_service_spec.rb +++ b/spec/services/system_note_service_spec.rb @@ -249,6 +249,30 @@ describe SystemNoteService do end end + describe '.change_due_date' do + subject { described_class.change_due_date(noteable, project, author, due_date) } + + let(:due_date) { Date.today } + + it_behaves_like 'a system note' do + let(:action) { 'due_date' } + end + + context 'when due date added' do + it 'sets the note text' do + expect(subject.note).to eq "changed due date to #{Date.today.to_s(:long)}" + end + end + + context 'when due date removed' do + let(:due_date) { nil } + + it 'sets the note text' do + expect(subject.note).to eq 'removed due date' + end + end + end + describe '.change_status' do subject { described_class.change_status(noteable, project, author, status, source) } |