+ def test_new_disabled
+ user = create(:user)
+
+ with_settings(:oauth_10_registration => false) do
+ get new_oauth_client_path(user)
+ assert_redirected_to login_path(:referer => new_oauth_client_path(user))
+
+ session_for(user)
+
+ get new_oauth_client_path(user)
+ assert_redirected_to oauth_clients_path(user)
+ end
+ end
+