diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2017-01-25 23:54:53 +0000 |
---|---|---|
committer | brian m. carlson <sandals@crustytoothpaste.net> | 2017-01-27 00:50:42 +0000 |
commit | 6c3e59a55e1b695f7ddc05895f7f756b3efa111e (patch) | |
tree | fdd0ec96e108052d1db61add50e08b5fcceccafd | |
parent | 256a7735f8cb8872a7f7595590300e2fd952428e (diff) | |
download | gitlab-ce-6c3e59a55e1b695f7ddc05895f7f756b3efa111e.tar.gz |
Ensure autogenerated title does not cause failing spec
Hardcode the title into the object in the spec, so that an autogenerated
title (such as one starting with "O") does not cause the spec to fail.
-rw-r--r-- | changelogs/unreleased/hardcode-title-system-note.yml | 4 | ||||
-rw-r--r-- | spec/services/system_note_service_spec.rb | 4 |
2 files changed, 7 insertions, 1 deletions
diff --git a/changelogs/unreleased/hardcode-title-system-note.yml b/changelogs/unreleased/hardcode-title-system-note.yml new file mode 100644 index 00000000000..1b0a63efa51 --- /dev/null +++ b/changelogs/unreleased/hardcode-title-system-note.yml @@ -0,0 +1,4 @@ +--- +title: Ensure autogenerated title does not cause failing spec +merge_request: 8963 +author: brian m. carlson diff --git a/spec/services/system_note_service_spec.rb b/spec/services/system_note_service_spec.rb index 9f5a0ac4ec6..bd7269045e1 100644 --- a/spec/services/system_note_service_spec.rb +++ b/spec/services/system_note_service_spec.rb @@ -245,6 +245,8 @@ describe SystemNoteService, services: true do end describe '.change_title' do + let(:noteable) { create(:issue, project: project, title: 'Lorem ipsum') } + subject { described_class.change_title(noteable, project, author, 'Old title') } context 'when noteable responds to `title`' do @@ -252,7 +254,7 @@ describe SystemNoteService, services: true do it 'sets the note text' do expect(subject.note). - to eq "changed title from **{-Old title-}** to **{+#{noteable.title}+}**" + to eq "changed title from **{-Old title-}** to **{+Lorem ipsum+}**" end end end |