X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/dbd88d893f3c3fce9cafd666b94396988646d81f..6b44a1976cf07ba50ba8aed8b34434e69a45e62d:/test/controllers/user_roles_controller_test.rb diff --git a/test/controllers/user_roles_controller_test.rb b/test/controllers/user_roles_controller_test.rb index f73fc9056..f9e321406 100644 --- a/test/controllers/user_roles_controller_test.rb +++ b/test/controllers/user_roles_controller_test.rb @@ -134,5 +134,10 @@ class UserRolesControllerTest < ActionController::TestCase end assert_redirected_to user_path(target_user.display_name) assert_equal "The string `no_such_role' is not a valid role.", flash[:error] + + # Revoking administrator role from current user should fail + post :revoke, :params => { :display_name => administrator_user.display_name, :role => "administrator" } + assert_redirected_to user_path(administrator_user.display_name) + assert_equal "Cannot revoke administrator role from current user.", flash[:error] end end