summaryrefslogtreecommitdiff
path: root/spec/services/system_note_service_spec.rb
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-01-25 23:54:53 +0000
committerbrian m. carlson <sandals@crustytoothpaste.net>2017-01-27 00:50:42 +0000
commit6c3e59a55e1b695f7ddc05895f7f756b3efa111e (patch)
treefdd0ec96e108052d1db61add50e08b5fcceccafd /spec/services/system_note_service_spec.rb
parent256a7735f8cb8872a7f7595590300e2fd952428e (diff)
downloadgitlab-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.
Diffstat (limited to 'spec/services/system_note_service_spec.rb')
-rw-r--r--spec/services/system_note_service_spec.rb4
1 files changed, 3 insertions, 1 deletions
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