diff options
Diffstat (limited to 'spec/models/note_spec.rb')
-rw-r--r-- | spec/models/note_spec.rb | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb index ca558848cb0..1fce1f97dcb 100644 --- a/spec/models/note_spec.rb +++ b/spec/models/note_spec.rb @@ -280,6 +280,32 @@ RSpec.describe Note do expect { note.destroy! }.not_to raise_error end end + + describe 'sets internal flag' do + subject(:internal) { note.reload.internal } + + let(:note) { create(:note, confidential: confidential, project: issue.project, noteable: issue) } + + let_it_be(:issue) { create(:issue) } + + context 'when confidential is `true`' do + let(:confidential) { true } + + it { is_expected.to be true } + end + + context 'when confidential is `false`' do + let(:confidential) { false } + + it { is_expected.to be false } + end + + context 'when confidential is `nil`' do + let(:confidential) { nil } + + it { is_expected.to be false } + end + end end describe "Commit notes" do |