Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/note_spec.rb')
-rw-r--r--spec/models/note_spec.rb15
1 files changed, 15 insertions, 0 deletions
diff --git a/spec/models/note_spec.rb b/spec/models/note_spec.rb
index c853f707e6d..86962cd8d61 100644
--- a/spec/models/note_spec.rb
+++ b/spec/models/note_spec.rb
@@ -191,6 +191,21 @@ describe Note do
end
end
+ describe "confidential?" do
+ it "delegates to noteable" do
+ issue_note = build(:note, :on_issue)
+ confidential_note = build(:note, noteable: create(:issue, confidential: true))
+
+ expect(issue_note.confidential?).to be_falsy
+ expect(confidential_note.confidential?).to be_truthy
+ end
+
+ it "is falsey when noteable can't be confidential" do
+ commit_note = build(:note_on_commit)
+ expect(commit_note.confidential?).to be_falsy
+ end
+ end
+
describe "cross_reference_not_visible_for?" do
let(:private_user) { create(:user) }
let(:private_project) { create(:project, namespace: private_user.namespace) { |p| p.add_master(private_user) } }