X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/7e5cbe87ed37f9cba8224fa4049047d7f981f66a..e2f1d0d4c2f50b1411b1bfb07d4c3d89992401c6:/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)