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

note_access_check_shared_examples.rb « models « shared_examples « support « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0c9992b832fcd97ebefabedf8c31b9a34cfe86a2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# frozen_string_literal: true

RSpec.shared_examples 'users with note access' do
  it 'returns true' do
    users.each do |user|
      expect(note.system_note_visible_for?(user)).to be_truthy
      expect(note.readable_by?(user)).to be_truthy
    end
  end
end

RSpec.shared_examples 'users without note access' do
  it 'returns false' do
    users.each do |user|
      expect(note.system_note_visible_for?(user)).to be_falsy
      expect(note.readable_by?(user)).to be_falsy
    end
  end
end