X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/df591042778408d03d410d5c22a669d85652d1ea..dd2e6f664a3e59e02349901a04e182bda6286f6f:/services/api/test/functional/arvados/v1/container_requests_controller_test.rb diff --git a/services/api/test/functional/arvados/v1/container_requests_controller_test.rb b/services/api/test/functional/arvados/v1/container_requests_controller_test.rb index b2cd366540..a3252ad7b3 100644 --- a/services/api/test/functional/arvados/v1/container_requests_controller_test.rb +++ b/services/api/test/functional/arvados/v1/container_requests_controller_test.rb @@ -32,7 +32,7 @@ class Arvados::V1::ContainerRequestsControllerTest < ActionController::TestCase post :create, { container_request: minimal_cr.merge( - secret_mounts: {'/foo' => {'type' => 'json', 'content' => 'bar'}}), + secret_mounts: {'/foo' => {'kind' => 'json', 'content' => 'bar'}}), } assert_response :success @@ -50,7 +50,7 @@ class Arvados::V1::ContainerRequestsControllerTest < ActionController::TestCase patch :update, { id: req.uuid, container_request: { - secret_mounts: {'/foo' => {'type' => 'json', 'content' => 'bar'}}, + secret_mounts: {'/foo' => {'kind' => 'json', 'content' => 'bar'}}, }, } assert_response :success @@ -65,7 +65,7 @@ class Arvados::V1::ContainerRequestsControllerTest < ActionController::TestCase test "update without deleting secret_mounts" do authorize_with :active req = container_requests(:uncommitted) - req.update_attributes!(secret_mounts: {'/foo' => {'type' => 'json', 'content' => 'bar'}}) + req.update_attributes!(secret_mounts: {'/foo' => {'kind' => 'json', 'content' => 'bar'}}) patch :update, { id: req.uuid, @@ -81,4 +81,21 @@ class Arvados::V1::ContainerRequestsControllerTest < ActionController::TestCase req.reload assert_equal 'bar', req.secret_mounts['/foo']['content'] end + + test "runtime_token not in #create responses" do + authorize_with :active + + post :create, { + container_request: minimal_cr.merge( + runtime_token: api_client_authorizations(:spectator).token) + } + assert_response :success + + resp = JSON.parse(@response.body) + refute resp.has_key?('runtime_token') + + req = ContainerRequest.where(uuid: resp['uuid']).first + assert_equal api_client_authorizations(:spectator).token, req.runtime_token + end + end