diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-09-20 02:18:09 +0300 |
commit | 6ed4ec3e0b1340f96b7c043ef51d1b33bbe85fde (patch) | |
tree | dc4d20fe6064752c0bd323187252c77e0a89144b /spec/models/note_spec.rb | |
parent | 9868dae7fc0655bd7ce4a6887d4e6d487690eeed (diff) |
Add latest changes from gitlab-org/gitlab@15-4-stable-eev15.4.0-rc42
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 |