Merge branch '8784-dir-listings'
[arvados.git] / services / api / test / functional / arvados / v1 / container_requests_controller_test.rb
1 # Copyright (C) The Arvados Authors. All rights reserved.
2 #
3 # SPDX-License-Identifier: AGPL-3.0
4
5 require 'test_helper'
6
7 class Arvados::V1::ContainerRequestsControllerTest < ActionController::TestCase
8   test 'create with scheduling parameters' do
9     authorize_with :system_user
10
11     sp = {'partitions' => ['test1', 'test2']}
12     post :create, {
13       container_request: {
14         command: ['echo', 'hello'],
15         container_image: 'test',
16         output_path: 'test',
17         scheduling_parameters: sp,
18       },
19     }
20     assert_response :success
21
22     cr = JSON.parse(@response.body)
23     assert_not_nil cr, 'Expected container request'
24     assert_equal sp, cr['scheduling_parameters']
25   end
26 end