Disable board edit buttons for select all/none when not privileged
ref: https://github.com/basecamp/fizzy/discussions/1992
This commit is contained in:
@@ -145,4 +145,25 @@ class BoardsControllerTest < ActionDispatch::IntegrationTest
|
||||
|
||||
assert_response :forbidden
|
||||
end
|
||||
|
||||
test "disables select all/none buttons for non-privileged user" do
|
||||
logout_and_sign_in_as :jz
|
||||
assert_not users(:jz).can_administer_board?(boards(:writebook))
|
||||
|
||||
get edit_board_path(boards(:writebook))
|
||||
|
||||
assert_response :success
|
||||
assert_select "button[disabled]", text: "Select all"
|
||||
assert_select "button[disabled]", text: "Select none"
|
||||
end
|
||||
|
||||
test "enables select all/none buttons for privileged user" do
|
||||
assert users(:kevin).can_administer_board?(boards(:writebook))
|
||||
|
||||
get edit_board_path(boards(:writebook))
|
||||
|
||||
assert_response :success
|
||||
assert_select "button:not([disabled])", text: "Select all"
|
||||
assert_select "button:not([disabled])", text: "Select none"
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user