Merge branch '8567-moar-docker' refs #8567
[arvados.git] / services / api / test / functional / arvados / v1 / containers_controller_test.rb
index cf1f5765b4d2460ae854356088d15bc7c8061add..65a1a915da26398e89f41203472304d97ae0082b 100644 (file)
@@ -87,4 +87,23 @@ class Arvados::V1::ContainersControllerTest < ActionController::TestCase
       assert_equal state, Container.where(uuid: uuid).first.state
     end
   end
+
+  test 'get current container for token' do
+    authorize_with :running_container_auth
+    get :current
+    assert_response :success
+    assert_equal containers(:running).uuid, json_response['uuid']
+  end
+
+  test 'no container associated with token' do
+    authorize_with :dispatch1
+    get :current
+    assert_response 404
+  end
+
+  test 'try get current container, no token' do
+    get :current
+    assert_response 401
+  end
+
 end