X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/15b104f4ff4614aa78c01180b6a9b89dd5a1400f..d3e91a79ff3ab35006b233d39e059ffa406ba443:/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