summaryrefslogtreecommitdiff
path: root/spec/services/system_note_service_spec.rb
diff options
context:
space:
mode:
authorEva Kadlecová <evka.kadl@gmail.com>2018-09-09 20:08:21 +0200
committerEva Kadlecová <evka.kadl@gmail.com>2018-09-09 21:43:37 +0200
commit997dda50f4567cf218df80c0fd5fe64afb18bf2e (patch)
treeabd34c4daf30c0cd03fd6d39b0ea0520b39baf08 /spec/services/system_note_service_spec.rb
parent120ce02e5e7e72654cb42edddc25ff3b057ec136 (diff)
downloadgitlab-ce-997dda50f4567cf218df80c0fd5fe64afb18bf2e.tar.gz
Add system note when due date is changed
Diffstat (limited to 'spec/services/system_note_service_spec.rb')
-rw-r--r--spec/services/system_note_service_spec.rb24
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 442de61f69b..4ce324d5671 100644
--- a/spec/services/system_note_service_spec.rb
+++ b/spec/services/system_note_service_spec.rb
@@ -288,6 +288,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) }