Policies specs (#23924)
This commit is contained in:
parent
6a57c42316
commit
00eb2269b6
17 changed files with 393 additions and 3 deletions
|
@ -39,6 +39,14 @@ RSpec.describe StatusPolicy, type: :model do
|
|||
expect(subject).to permit(alice, status)
|
||||
end
|
||||
|
||||
it 'grants access when direct and non-owner viewer is mentioned and mentions are loaded' do
|
||||
status.visibility = :direct
|
||||
status.mentions = [Fabricate(:mention, account: bob)]
|
||||
status.mentions.load
|
||||
|
||||
expect(subject).to permit(bob, status)
|
||||
end
|
||||
|
||||
it 'denies access when direct and viewer is not mentioned' do
|
||||
viewer = Fabricate(:account)
|
||||
status.visibility = :direct
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue