10935: Add test that round tripping works after disabling deep_munge.
[arvados.git] / services / api / test / integration / noop_deep_munge.rb
1 require 'test_helper'
2
3 class NoopDeepMunge < ActionDispatch::IntegrationTest
4
5   test "that empty list round trips properly" do
6     post "/arvados/v1/container_requests",
7          {
8            :container_request => {
9              :name => "workflow",
10              :state => "Uncommitted",
11              :command => ["echo"],
12              :container_image => "arvados/jobs",
13              :output_path => "/",
14              :mounts => {
15                :foo => {
16                  :kind => "json",
17                  :content => {
18                    :a => [],
19                    :b => {}
20                  }
21                }
22              }
23            }
24          }.to_json, {'HTTP_AUTHORIZATION' => "OAuth2 #{api_client_authorizations(:admin).api_token}",
25                     'CONTENT_TYPE' => 'application/json'}
26     assert_response :success
27     assert_equal "arvados#containerRequest", json_response['kind']
28     content = {
29       "a" => [],
30       "b" => {}
31     }
32     assert_equal content, json_response['mounts']['foo']['content']
33
34   end
35 end