diff options
author | Matt Jankowski <matt@jankowski.online> | 2023-03-04 10:57:22 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-04 16:57:22 +0100 |
commit | 00eb2269b691b90f361dd03454cf823934389282 (patch) | |
tree | 9570ca0e075a4b7ed3b8db80746a5a19b5db37b2 /spec/policies/status_policy_spec.rb | |
parent | 6a57c423169d76301078948821c1da916dcdf75b (diff) |
Policies specs (#23924)
Diffstat (limited to 'spec/policies/status_policy_spec.rb')
-rw-r--r-- | spec/policies/status_policy_spec.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/policies/status_policy_spec.rb b/spec/policies/status_policy_spec.rb index b88521708..9ae54780e 100644 --- a/spec/policies/status_policy_spec.rb +++ b/spec/policies/status_policy_spec.rb @@ -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 |