mirror of
https://github.com/basecamp/once-campfire.git
synced 2026-09-18 22:34:56 +09:00
Enforce restriction to create new rooms
This commit is contained in:
@@ -24,6 +24,15 @@ class Rooms::OpensControllerTest < ActionDispatch::IntegrationTest
|
||||
assert_redirected_to room_url(Room.last)
|
||||
end
|
||||
|
||||
test "create forbidden by non-admin when account restricts creation to admins" do
|
||||
accounts(:signal).restrict_room_creation_to_administrators = true
|
||||
accounts(:signal).save!
|
||||
|
||||
sign_in :jz
|
||||
post rooms_opens_url, params: { room: { name: "My New Room" } }
|
||||
assert_response :forbidden
|
||||
end
|
||||
|
||||
test "only admins or creators can update" do
|
||||
sign_in :jz
|
||||
|
||||
|
||||
Reference in New Issue
Block a user