Allow non-admins to update their room involvements

This commit is contained in:
Michael Halliday
2025-12-03 09:56:15 -05:00
parent b3d97ecb0e
commit b8919161a8
2 changed files with 9 additions and 2 deletions

View File

@@ -1,8 +1,6 @@
class Rooms::InvolvementsController < ApplicationController
include RoomScoped
before_action :ensure_can_administer, only: %i[ update ]
def show
@involvement = @membership.involvement
end

View File

@@ -43,4 +43,13 @@ class Rooms::InvolvementsControllerTest < ActionDispatch::IntegrationTest
end
end
end
test "a non-admin can update their room involvement" do
sign_in :jz
assert_changes -> { memberships(:jz_designers).reload.involvement }, from: "everything", to: "mentions" do
put room_involvement_url(rooms(:designers)), params: { involvement: "mentions" }
assert_redirected_to room_involvement_url(rooms(:designers))
end
end
end