2020-04-08 14:13:33 +05:30
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.shared_examples 'users with note access' do
|
2020-04-08 14:13:33 +05:30
|
|
|
it 'returns true' do
|
|
|
|
users.each do |user|
|
|
|
|
expect(note.system_note_with_references_visible_for?(user)).to be_truthy
|
|
|
|
expect(note.readable_by?(user)).to be_truthy
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
2020-07-28 23:09:34 +05:30
|
|
|
RSpec.shared_examples 'users without note access' do
|
2020-04-08 14:13:33 +05:30
|
|
|
it 'returns false' do
|
|
|
|
users.each do |user|
|
|
|
|
expect(note.system_note_with_references_visible_for?(user)).to be_falsy
|
|
|
|
expect(note.readable_by?(user)).to be_falsy
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|