diff options
Diffstat (limited to 'spec/support/shared_examples/models/synthetic_note_shared_examples.rb')
-rw-r--r-- | spec/support/shared_examples/models/synthetic_note_shared_examples.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/support/shared_examples/models/synthetic_note_shared_examples.rb b/spec/support/shared_examples/models/synthetic_note_shared_examples.rb new file mode 100644 index 00000000000..a41ade2950a --- /dev/null +++ b/spec/support/shared_examples/models/synthetic_note_shared_examples.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +RSpec.shared_examples 'a synthetic note' do |action| + it_behaves_like 'a system note', exclude_project: true do + let(:action) { action } + end + + describe '#discussion_id' do + before do + allow(event).to receive(:discussion_id).and_return('foobar42') + end + + it 'returns the expected discussion id' do + expect(subject.discussion_id(nil)).to eq('foobar42') + end + end +end |