diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2022-02-10 00:15:30 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-02-10 00:15:30 +0100 |
commit | 63002cde03a836b4510aca5da564504ecaedb5e9 (patch) | |
tree | f6749dd6bafae30c8708559da037668f5585b16e /spec/policies | |
parent | 20a3564ab280a004cc7c075c00f63e70b1d65e07 (diff) |
Add editing for published statuses (#17320)
* Add editing for published statuses * Fix change of multiple-choice boolean in poll not resetting votes * Remove the ability to update existing media attachments for now
Diffstat (limited to 'spec/policies')
-rw-r--r-- | spec/policies/status_policy_spec.rb | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/spec/policies/status_policy_spec.rb b/spec/policies/status_policy_spec.rb index 1cddf4abd..28b808ee2 100644 --- a/spec/policies/status_policy_spec.rb +++ b/spec/policies/status_policy_spec.rb @@ -125,7 +125,7 @@ RSpec.describe StatusPolicy, type: :model do end end - permissions :index?, :update? do + permissions :index? do it 'grants access if staff' do expect(subject).to permit(admin.account) end @@ -134,4 +134,18 @@ RSpec.describe StatusPolicy, type: :model do expect(subject).to_not permit(alice) end end + + permissions :update? do + it 'grants access if staff' do + expect(subject).to permit(admin.account, status) + end + + it 'grants access if owner' do + expect(subject).to permit(status.account, status) + end + + it 'denies access unless staff' do + expect(subject).to_not permit(bob, status) + end + end end |