X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/aa1fb6dbb8c2e71b8ce8c231ae1272a2dfebd75a..99492de1d30fcc93576e33b6b0362a455105f72c:/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