From 6c3e59a55e1b695f7ddc05895f7f756b3efa111e Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Wed, 25 Jan 2017 23:54:53 +0000 Subject: 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. --- changelogs/unreleased/hardcode-title-system-note.yml | 4 ++++ spec/services/system_note_service_spec.rb | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 changelogs/unreleased/hardcode-title-system-note.yml 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 -- cgit v1.2.1