Merge branch 'master' into 2244-sdk-docs
[arvados.git] / services / api / test / functional / arvados / v1 / api_client_authorizations_controller_test.rb
index c63f40f5362795ce65e62d4010f339fec165eb6a..cbb009617b752b7970b0a3fb3820f502728e37f6 100644 (file)
@@ -20,4 +20,22 @@ class Arvados::V1::ApiClientAuthorizationsControllerTest < ActionController::Tes
     assert_response 403
   end
 
+  test "create system auth" do
+    authorize_with :admin_trustedclient
+    post :create_system_auth, scopes: '["test"]'
+    assert_response :success
+  end
+
+  test "prohibit create system auth with token from non-trusted client" do
+    authorize_with :admin
+    post :create_system_auth, scopes: '["test"]'
+    assert_response 403
+  end
+
+  test "prohibit create system auth by non-admin" do
+    authorize_with :active
+    post :create_system_auth, scopes: '["test"]'
+    assert_response 403
+  end
+
 end