diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 09:55:51 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2021-07-20 09:55:51 +0000 |
commit | e8d2c2579383897a1dd7f9debd359abe8ae8373d (patch) | |
tree | c42be41678c2586d49a75cabce89322082698334 /spec/models/event_spec.rb | |
parent | fc845b37ec3a90aaa719975f607740c22ba6a113 (diff) | |
download | gitlab-ce-e8d2c2579383897a1dd7f9debd359abe8ae8373d.tar.gz |
Add latest changes from gitlab-org/gitlab@14-1-stable-eev14.1.0-rc42
Diffstat (limited to 'spec/models/event_spec.rb')
-rw-r--r-- | spec/models/event_spec.rb | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/spec/models/event_spec.rb b/spec/models/event_spec.rb index 949e8ec0a72..fc229dcaa22 100644 --- a/spec/models/event_spec.rb +++ b/spec/models/event_spec.rb @@ -268,6 +268,7 @@ RSpec.describe Event do let(:design) { create(:design, issue: issue, project: project) } let(:note_on_commit) { create(:note_on_commit, project: project) } let(:note_on_issue) { create(:note_on_issue, noteable: issue, project: project) } + let(:confidential_note) { create(:note, noteable: issue, project: project, confidential: true) } let(:note_on_confidential_issue) { create(:note_on_issue, noteable: confidential_issue, project: project) } let(:note_on_project_snippet) { create(:note_on_project_snippet, author: author, noteable: project_snippet, project: project) } let(:note_on_personal_snippet) { create(:note_on_personal_snippet, author: author, noteable: personal_snippet, project: nil) } @@ -399,6 +400,16 @@ RSpec.describe Event do include_examples 'visible to assignee and author', true end + context 'confidential note' do + let(:target) { confidential_note } + + include_examples 'visibility examples' do + let(:visibility) { visible_to_none_except(:member) } + end + + include_examples 'visible to author', true + end + context 'private project' do let(:project) { private_project } let(:target) { note_on_issue } @@ -967,14 +978,13 @@ RSpec.describe Event do describe '#action_name' do it 'handles all valid design events' do - created, updated, destroyed, archived = %i[created updated destroyed archived].map do |trait| + created, updated, destroyed = %i[created updated destroyed].map do |trait| build(:design_event, trait).action_name end expect(created).to eq('uploaded') expect(updated).to eq('revised') expect(destroyed).to eq('deleted') - expect(archived).to eq('archived') end it 'handles correct push_action' do |