diff options
author | Robert Speicher <rspeicher@gmail.com> | 2015-05-27 04:49:04 +0300 |
---|---|---|
committer | Robert Speicher <rspeicher@gmail.com> | 2015-05-27 04:49:04 +0300 |
commit | 1aa3921dd8b0084260fa381ed79580b4b54284b6 (patch) | |
tree | 500c7e3c93af1cc339e3627bb5d4779909c77ec7 /spec/services/system_note_service_spec.rb | |
parent | 0ec1e4c028b6e663929b38f1c90f4158f9a49cc2 (diff) |
Add a note when an Issue or Merge Request's title changes
Diffstat (limited to 'spec/services/system_note_service_spec.rb')
-rw-r--r-- | spec/services/system_note_service_spec.rb | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb index 4e4cb6d19ed..6d8c71f94f9 100644 --- a/spec/services/system_note_service_spec.rb +++ b/spec/services/system_note_service_spec.rb @@ -207,6 +207,27 @@ describe SystemNoteService do end end + describe '.change_title' do + subject { described_class.change_title(noteable, project, author, 'Old title') } + + context 'when noteable responds to `title`' do + it_behaves_like 'a system note' + + it 'sets the note text' do + expect(subject.note). + to eq "Title changed from **Old title** to **#{noteable.title}**" + end + end + + context 'when noteable does not respond to `title' do + let(:noteable) { double('noteable') } + + it 'returns nil' do + expect(subject).to be_nil + end + end + end + describe '.cross_reference' do subject { described_class.cross_reference(noteable, mentioner, author) } |