X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/99f5d5159542171d5b3549a2cf0f0d801ea5d88b..b8fad531e47641fc402203edc732c1484d28733a:/test/controllers/oauth_clients_controller_test.rb diff --git a/test/controllers/oauth_clients_controller_test.rb b/test/controllers/oauth_clients_controller_test.rb index fb651ff3c..f106b4af6 100644 --- a/test/controllers/oauth_clients_controller_test.rb +++ b/test/controllers/oauth_clients_controller_test.rb @@ -74,6 +74,22 @@ class OauthClientsControllerTest < ActionDispatch::IntegrationTest end end + def test_new_disabled + user = create(:user) + + with_settings(:oauth_10_registration => false) do + get new_oauth_client_path(:display_name => user.display_name) + assert_response :redirect + assert_redirected_to login_path(:referer => new_oauth_client_path(:display_name => user.display_name)) + + session_for(user) + + get new_oauth_client_path(:display_name => user.display_name) + assert_response :redirect + assert_redirected_to oauth_clients_path(:display_name => user.display_name) + end + end + def test_create user = create(:user)