X-Git-Url: https://git.openstreetmap.org./rails.git/blobdiff_plain/e0d0b68785bd1a765b796a826eeeb2782f841ada..84ff3ed43acb29f332b2811b887007981a055e35:/test/controllers/oauth2_authorizations_controller_test.rb diff --git a/test/controllers/oauth2_authorizations_controller_test.rb b/test/controllers/oauth2_authorizations_controller_test.rb index 854f7cde5..012bfd7f4 100644 --- a/test/controllers/oauth2_authorizations_controller_test.rb +++ b/test/controllers/oauth2_authorizations_controller_test.rb @@ -102,6 +102,20 @@ class Oauth2AuthorizationsControllerTest < ActionDispatch::IntegrationTest assert_select "p", "The requested scope is invalid, unknown, or malformed." end + def test_new_db_readonly + application = create(:oauth_application, :scopes => "write_api") + + session_for(create(:user)) + + with_settings(:status => "database_readonly") do + get oauth_authorization_path(:client_id => application.uid, + :redirect_uri => application.redirect_uri, + :response_type => "code", + :scope => "write_api") + assert_redirected_to offline_path + end + end + def test_create application = create(:oauth_application, :scopes => "write_api")